title: ndk.dir error in Android Studio
body: <p>I was trying to use opencv library, so I imported one of its projects in Android Studio and when I tried to run it I got this error:</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':openCVSamplefacedetection:compileDebugNdk'.
    NDK not configured.
    Download the NDK from <a href="http://developer.android.com/tools/sdk/ndk/.Then" rel="nofollow">http://developer.android.com/tools/sdk/ndk/.Then</a> add ndk.dir=path/to/ndk in local.properties.
    (On Windows, make sure you escape backslashes, e.g. C:\ndk rather than C:\ndk)</p>
  </blockquote>
  
  <p>So I downloaded the ndk and I addes this line to the local.properties file where it became:</p>
  
  <pre><code>sdk.dir=C\:\\Users\\skoon\\AppData\\Local\\Android\\sdk
  ndk.dir=C\:\\Users\\skoon\\AppData\\Roaming\\IDM\\android-ndk-r10d
  </code></pre>
  
  <p>but I still got this error which I didn't understand:</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':openCVSamplefacedetection:compileDebugNdk'.
    com.android.ide.common.internal.LoggedErrorException: Failed to run 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: *** No rule to make target '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/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', needed by `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/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.</p>
  </blockquote>
  
  <p>I didn't change anything in the code, so what should I do? do I need to change or add any variables to point to the ndk?</p>
  
  <p>P.S. This is my first time trying to build Android application so I don't have any experience.</p>
  
  <p>Thank you in advance.</p>
  
  <p>UPDATE:</p>
  
  <p>To import the project I just used import project from file, then I synced the gardle, and run the project.
  the package that I downloaded from opencv was the Android one, and I tried to use the face detection sample.
  when I run it I got the error above.</p>