Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't setup Android NDK location in Android Studio

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?

like image 984
Bohdan Bessonov Avatar asked Sep 15 '25 15:09

Bohdan Bessonov


2 Answers

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
like image 169
Albert Vila Calvo Avatar answered Sep 18 '25 10:09

Albert Vila Calvo


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

like image 39
Piotr Kedra Avatar answered Sep 18 '25 10:09

Piotr Kedra