disclaimer: I work on Android Studio
With newer version (3.6+) of Android Gradle Plugin, please download with "NDK (Side by side)" option from the SDK manager and then specify ndkVersion
in the build.gradle
with the full version of NDK that is locally available from your machine.
For example, after you downloaded NDK 20.1.5948944 under "NDK (Side by side)" from the SDK manager, the downloaded NDK would be, by default, under ~/Android/Sdk/ndk/20.1.5948944
. Then in your module level build.gradle
, you need something like the following.
android {
compileSdkVersion 29
defaultConfig {
// ...
}
buildTypes {
// ...
}
externalNativeBuild {
// ...
}
ndkVersion "20.1.5948944" // <<==== Here
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…