4

I set default location for AndroidSDK and JDK, but I can't set location for Android NDK - the field is grayed out.

Disabled NDK path editing

I downloaded NDK to some folder, set up ANDROID_NDK_HOME and NDK_HOME vars. What's wrong?

3 Answers 3

2

It was grayed for me too.

I fixed the problem by adding the NDK location to my local.properties file, eg:

ndk.dir=/Users/myusername/Library/Android/sdk/ndk/22.1.7171670 
Sign up to request clarification or add additional context in comments.

Comments

1

I needed to install NDK for my react-native project, but same I couldn't set it up in android studio because it was grayed out...

Here is what worked for me (based on protossor answer in this post):

  1. In android studio go to File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools -> and install NDK (Side by side) enter image description here

  2. Set up the enviromental virables NDK_HOME and NDK_MODULE_PATH (in my case both: C:\Users\piotr\AppData\Local\Android\Sdk\ndk\23.0.7123448 )

  3. Finally in app/build.gradle change ndkVersion for exactly the one u have installed. For me like this: enter image description here

Comments

0

Download zip folder from the link NDK LINK

Then Extract to the location of the drive Set NDK path to the NDK option as shown in the above image NDK IMAGE

Hope it helps.

6 Comments

So I can't have NDK in different directory? I can set it up in Android project, but not as default folder
Update: I used your way, folder is set, but I can change it ONLY in specific project, and not globally
Which os your using?
If windows add folder path to environment. Similarly how will set java path to windows environment Set Environment Path Hope it helps..
Where is above image mentioned in your text? what is name of the environment variable that supposed to add? also the button squared red in your "below image" is still disabled even if NDK is extracted in that folder.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.