Reputation: 805
In project settings (File -> Project Structure) 'Android NDK location' field is greyed out:
Clicking on 'Download Android NDK' briefly displays some dialog. There are several versions of NDK installed:
What is wrong with my setup?
Host: Ubuntu 18.04 LTS
Android Studio 4.1.1 Build #AI-201.8743.12.41.6953283, built on November 5, 2020 Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.15.0-128-generic GC: ParNew, ConcurrentMarkSweep Memory: 2014M Cores: 4 Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true, debugger.watches.in.variables=false Non-Bundled Plugins: com.intellij.ideolog, org.jetbrains.kotlin Current Desktop: LXDE
Submitted bug report
Upvotes: 23
Views: 15111
Reputation: 592
With a project open, click Tools > SDK Manager.
Click the SDK Tools tab.
Select the NDK (Side by side) and CMake checkboxes.
Upvotes: 1
Reputation: 502
ndkVersion '22.0.7026061'
in build.gradle(app) like this
externalNativeBuild { ndkBuild { path file('src/main/jni/Android.mk') } } ndkVersion '22.0.7026061' // your desire version dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) }
Close Android Studio.
Delete .temp folder located
C:\Users\%USERNAME%\AppData\Local\Android\Sdk
(if exist)
Delete Options Folder located in
C:\Users\%USERNAME%\AppData\Roaming\Google\AndroidStudio4.1\
Delete NDK or ndk-bundle folder located in your SDK directory... in my case D:\Android\SDK\ndk
Now clean temps from SDK Manager > Optimize disk Space [don't worry it will not delete your essential files]
Upvotes: 30
Reputation: 1521
I had this problem and by setting NDK value in local.properties file of my project, that problem gone
ndk.dir=D\:\\mySdkFolder\\sdk\\myNdkFolder
sdk.dir=D\:\\mySdkFolder\\sdk
Upvotes: 8