Issue
I am using the latest version of Android studio V4.1 to implement my project on Windows 10. The project also requires Java 11 and Ndk libraries.
First, I installed NDK V22 and V16 as well as Cmak from SDK tools in SKD manger as shown below:
Then, Installed Java 11 from Oracel.com, and checked using cmd as shown below:
I added the paths of SDK and NDK to the local.properties files as follows:
sdk.dir=C\:\\Users\\user_name\\AppData\\Local\\Android\\Sdk
ndk.dir=C\:\\Users\\user_name\\AppData\\Local\\Android\\Sdk\\ndk\\22.0.7026061
Also, added JAVA_HOME and ANDROID_NDK_HOME in the system environment.
The problem is that I can not locate the NDK path from the "File > project structure> Android NDK location" in the Android project to tell the Android studio where is the NDK is located. It always shows as inactive and can not browse the path as shown in the below picture:
Info: Android Gradle Plugin Version 4.1.1
Gradle Version 6.8
Can anyone help to fix this problem?
Solution
This was moved to the build.gradle to keep builds reproducible: https://developer.android.com/studio/releases/gradle-plugin#ndk-path
It's not in the UI because you should almost never use it. You should be using android.ndkVersion
in almost all cases. android.ndkPath
(and ndk.dir
) is just a way to make builds non-reproducible/non-portable.
The cases where android.ndkPath
makes sense are if your CI service only has the NDK installed to a specific location not known to the SDK, or if you're using an unreleased NDK.
Answered By - Dan Albert
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.