I want to try one of the sample codes shipped with SDK, namely "tutorial-2-mixedprocessing". I followed these steps:

1) Import Project -> selected tutorial directory

2) I named it “tutorial-2-mixedprocessing1”, left 3 options ticked (“Replace jars&lib sources when possible” and “Create Gradle-style module names”) 

3) *Warning: “NDK integration deprecated in the current plugin”* I clicked *“Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration”*

4) Import module -> Selected java module which is in “C:\SDKs\OpenCV-android-sdk\sdk\java” in my case -> Left 3 checkbox ticked

5) *Error:Cause: failed to find target with hash string 'android-14' in: C:\Users\c010\AppData\Local\Android\Sdk Install missing platform(s) and sync project.* I changed compileSdkversion, buildToolsVersion and targetSdkVersion and synced. Error dissapeared. 

6-7) Open module settings -> Dependencies Added Opencv module as module dependency. Added NDK location (“C:\SDKs\android-ndk-r12-beta2” in my case)

8) Build -> make project leads *Error:(2, 33) opencv2/core/core.hpp: No such file or directory*

In Eclipse I would add some include paths, but I don’t know how to do it in Android Studio. I thought editing Android.mk could help:

My Android.mk was

```
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

ifdef OPENCV_ANDROID_SDK
  ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)")
    include ${OPENCV_ANDROID_SDK}/OpenCV.mk
  else
    include ${OPENCV_ANDROID_SDK}/sdk/native/jni/OpenCV.mk
  endif
else
  include ../../sdk/native/jni/OpenCV.mk
endif

LOCAL_MODULE    := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS +=  -llog -ldl

include $(BUILD_SHARED_LIBRARY)

```

I changed it to plain absolute path

```
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include C:\SDKs\OpenCV-android-sdk\sdk\native\jni\OpenCV.mk

LOCAL_MODULE    := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS +=  -llog -ldl

include $(BUILD_SHARED_LIBRARY)

```

Didn’t help.

I added 'OPENCV\_ANDROID\_SDK := C:\SDKs\OpenCV-android-sdk\' before “ifdef ...” line, same result. 

I added 'LOCAL\_C\_INCLUDES += C:\SDKs\OpenCV-android-sdk\sdk\native\jni\include' , same result.

I edited gradle file which looked like 

```
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "org.opencv.samples.tutorial2"
        minSdkVersion 8
        targetSdkVersion 8

        ndk {
            moduleName "mixed_sample"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':openCVLibrary310')
}

```

I changed ndk bracket as follows: 

```
ndk {
    moduleName "mixed_sample"
    cFlags  += "-I${file("C:/SDKs/OpenCV-android-sdk/sdk/native/jni/include")}".toString()
}

```

*Error:error: null-IC:\SDKs\OpenCV-android-sdk\sdk\native\jni\include: Invalid argument*

It didn't accept cppFlags *Error:(14, 0) Could not find property 'cppFlags' on com.android.build.gradle.internal.dsl.NdkOptions\_Decorated@797a42f2.*