Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NDK is not configured issue in android studio

People also ask

How do I know if NDK is installed?

Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.

Where is NDK installed?

Android Studio installs all versions of the NDK in the android-sdk /ndk/ directory. Each version is located in a subdirectory with the version number as its name.

Is NDK necessary for Android Studio?

The Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with Android. CMake: an external build tool that works alongside Gradle to build your native library. You do not need this component if you only plan to use ndk-build.


This is the problem faced by Android studio users in Windows environment. First for NDK not Configured problem

Go to local.properties file and give ndk path... for ex :

#Wed Mar 18 14:10:33 IST 2015
sdk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\sdk1
ndk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\ndk

Then for the Next Problem or Error...

Goto JNI Folder and create an empty c file by any name... Then your problem will be solved...

Some Quick links about this are http://ph0b.com/android-studio-gradle-and-ndk-integration/ And https://code.google.com/p/android/issues/detail?id=66937


Go to option File->Project Structure

enter image description here

Select SDK Location->Android NDK Location and choose NDK listed in dropdown

enter image description here


For whatever reason, setting ndk.dir on the properties file is not working for me. However, setting/exporting the variable ANDROID_NDK_HOME prior to launching android studio did the trick.

Bash syntax (paths below are specific to my installation)

export ANDROID_HOME=/opt/android-sdk-linux
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle

Environment

Ubuntu Linux x64/GNU bash, version 4.4/Android Studio 2.2.3

Goto Files -> Project Structure -> SDK Location

Android NDK Location is at the bottom right of the window.