Things to be checked if you are facing this error:
- Check whether Ndk location is specified or not in local.properties file.
If not, go to the NDK location inside your sdk folder,if there are multiple ndk versions delete previous versions if you don't need. Go inside the latest version folder and check whether source.properties file is present or not. Copy the folder path and specify the path in the local.properties file.
For me it is
ndk.dir=C:\Users\admin\AppData\Local\Android\Sdk\ndk\22.0.6917172
- In app level build.gradle file specify the version number if it is incorrect
For me it is
android {
ndkVersion '22.0.6917172'
}
Important note:
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.
You can visit this official page for more details