Ndk.dir error in Android Studio

I tried to use the opencv library, so I imported one of my projects into Android Studio, and when I tried to start it, I got this error:

Error: execution completed for task ': openCVSamplefacedetection: compileDebugNdk'. NDK is not configured. Download the NDK from http://developer.android.com/tools/sdk/ndk/.Then add ndk.dir = path / to / ndk to local.properties. (On Windows, make sure you strip backslash, like C: \ ndk, not C: \ ndk)

So, I downloaded ndk, and I add this line to the local.properties file, where it became:

sdk.dir=C\:\\Users\\skoon\\AppData\\Local\\Android\\sdk
ndk.dir=C\:\\Users\\skoon\\AppData\\Roaming\\IDM\\android-ndk-r10d

but I still got this error that I did not understand:

Error: execution completed for task ': openCVSamplefacedetection: compileDebugNdk'. com.android.ide.common.internal.LoggedErrorException: Failed to run the command: C: \ Users \ skoon \ AppData \ Roaming \ IDM \ android-ndk-r10d \ ndk-build.cmd NDK_PROJECT_PATH = null APP_BUILD_SCRIPT = C: \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-sdk \ OpenCV-2.4.10-android-sdk \ samples \ face-detection \ openCVSamplefacedetection \ build \ intermediates \ ndk \ debug \ Android.mk APP_PLATFORM = android- 14 NDK_OUT = C: \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-sdk \ OpenCV-2.4.10-android-sdk \ samples \ face-detection \ openCVSamplefacedetection \ build \ intermediates \ ndk \ debug \ obj NDK_LIBS_OUT = C: \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-sdk \ OpenCV-2.4.10-android-sdk \ samples \ face-detection \ openCVSamplefacedetection \ build \ intermediates \ ndk \ debug \ lib APP_ABI = all Error code: 2 Output: make.exe: *** There is no rule to create the target 'C: \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-sdk \ OpenCV-2.4.10-android-sdk \ samples \ face-detection \ openCVSamplefacedetection \ build \ intermediate \ NDK \ Debug \ OBJ / local / arm64-V8A / OBJS / detection_based_tracker / C_ \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-SDK \ OpenCV-2.4.10-android- sdk \ samples \ face-detection \ openCVSamplefacedetection \ src \ main \ jni 'required `C: \ Users \ skoon \ Downloads \ Compressed \ OpenCV-2.4.10-android-sdk \ OpenCV-2.4.10-android-sdk \ samples \ face detection \ openCVSamplefacedetection \ build \ intermediate \ NDK \ Debug \ OBJ / local /arm64-V8A/OBJS/detection_based_tracker/C_\Users\skoon\Downloads\Compressed\OpenCV-2.4.10-android-SDK \ OpenCV -2.4.10-android-SDK \ samples \ face detection \ openCVSamplefacedetection \ SRC \ main \ JNI \ DetectionBasedTracker_jni.o ". Stop.

, ? - , ndk?

P.S. , Android, .

.

UPDATE:

, , gardle . , opencv, Android one, . , .

+1
3

librairies OpenCV . .

+1

OpenCV gradle. , , , . Android Studio + NDK + OpenCV. . https://github.com/quanhua92/NDK_OpenCV_AndroidStudio

0

NDK SDK, "build.gradle",

sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/', 'src/main/jni/'] } }

sourceSets.main { jniLibs.srcDir 'src/main/jniLibs' // mention your JNI lib path(where ".so" files contains) jni.srcDirs = [] //disable automatic ndk-build call }

I am trying to configure OpenCV and its fixed

0
source

All Articles