Problem with Android Studio ndk.dir

I downloaded and installed ndk (android-ndk-r9d) here C: \ Program Files (x86) \ Android \ android-ndk-r9d

I added the ndk.dir property to local.properties:

sdk.dir=C\:\\Program Files (x86)\\Android\\android-studio\\sdk ndk.dir=C\:\\Program Files (x86)\\Android\\android-studio\\android-ndk-r9d 

I added a system environment variable:

ANDROID_NDK_HOME = C: \ Program Files (x86) \ Android \ android-ndk-r9d

I confirmed that ndk-build is in the directory associated

I have confirmed that the build.gradle property is suitable (version wise)

 dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } 

I confirmed that my version of Android Studio is correct: 0.5.5

I still get this:

 Error:Execution failed for task ':muPdf:compileReleaseNdk'. > NDK not configured. Download the NDK from http://developer.android.com/tools/sdk/ndk/.Then add ndk.dir=path/to/ndk in local.properties. (On Windows, make sure you escape backslashes, eg C:\\ndk rather than C:\ndk) 
+6
source share
3 answers

It looks like the environment path and local.properties files point to different locations:

PATH: C:\Program Files (x86)\Android\android-ndk-r9d

local.properties: C\:\\Program Files (x86)\\Android\\android-studio\\android-ndk-r9d

Make sure this is correct. You can save the PATH and abandon declerations local.properties, and then try this command through console : ndk-build -? to find out if it is found in PATH

+4
source

I had a similar problem to understand that only NDK was not installed (same error message).

I just went to the Android SDK Manager and installed the NDK package.

Post that I just chose the default path in the settings and worked.

+3
source

Install NDK in the SDK manager, if you have already installed the open application "build.gradle", replace these lines

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

to

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

0
source

All Articles