Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build error with NDK version - ndk.dir version which disagrees with android.ndkVersion

After upgrading the Gradle plugin and Android Studio 4.2.1. I face this error while building the C++ library.

Caused by: com.android.builder.errors.EvalIssueException: NDK from ndk.dir at D:\Sdk\ndk\18.0.5002713 had version [18.0.x] which disagrees with android.ndkVersion [22.1.x]
like image 329
Qamar Avatar asked Oct 15 '25 14:10

Qamar


1 Answers

Very simple solution. Remove ndk.dir from local.properties,

and declare ndkVersion inside build.gradle in app/library level

android {
    compileSdkVersion 30
    ndkVersion "18.0.5002713"
    ...
}

Thanks

like image 65
Qamar Avatar answered Oct 17 '25 03:10

Qamar