Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModelCache.safeGet(androidProjectResult.androidProject::getNdkVersion, "") must not be null

When I Updated the Android Studio to the Bumblebee 2021.1.1 I got this error:

ModelCache.safeGet(androidProjectResult.androidProject::getNdkVersion, "") must not be null

I have already added ndk.dir to local.properties but I still have the error.

sdk.dir=/path/to/sdk
ndk.dir=/path/to/ndk
like image 450
Payam Roozbahani Fard Avatar asked Feb 26 '26 17:02

Payam Roozbahani Fard


2 Answers

enter image description here

Add ndk path in android.ndkPath

Or

Add ndkVersion '23.0.7599858' (If you use this approach then in some case you have to add version in other library module if they use ndk)

enter image description here


You can also add this using File-> Project Structure

Project Structure

like image 161
Bhavin Patel Avatar answered Mar 02 '26 04:03

Bhavin Patel


The value for ndk.dir should no longer be set in your app's local.properties file, and support for this ndk.dir setting will be removed in a future version. The Android Gradle Plugin sets the NDK version by default, but if you need a specific version of the NDK, you can set android.ndkVersion in build.gradle.

  1. Remove ndk.dir=/path/to/ndk from the local.properties.
  2. go to build.gradle under android section add ndkVersion='required ndk version'

ex:

android {

ndkVersion '23.1.7779620'

}

Reference : Android office doc's

like image 29
Zoo Zoo Avatar answered Mar 02 '26 04:03

Zoo Zoo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!