My Android studio is version 3.3.2 and i trying to link gradle to my native library, my module's build.gradle is:
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk {
moduleName "MyModule"
abiFilters 'x86', 'armeabi-v7a'
}
}
externalNativeBuild {
cmake {
version "3.10.2" // The key line
path file('CMakeLists.txt')
}
}
}
If i don't specify the cmake version to '3.10.2', I am getting the following error:
CMake '3.6.0' was not found in PATH or by cmake.dir property. - CMake '3.10.2' found in SDK did not match requested version '3.6.0'. - CMake '3.12.1' found in PATH did not match requested version '3.6.0'. Install CMake 3.6.0
So I'am confused why is so! Why does it ask for the version of cmake itself to be 3.6.0.
Kindly review and give feedback.
CMake: an external build tool that works alongside Gradle to build your native library. You do not need this component if you only plan to use ndk-build. LLDB: the debugger Android Studio uses to debug native code. By default, LLDB will be installed alongside Android Studio.
The CMake toolchain file The toolchain file used for the NDK is located in the NDK at <NDK>/build/cmake/android.
Android Studio installs all versions of the NDK in the android-sdk /ndk/ directory. Each version is located in a subdirectory with the version number as its name. Note: Remove this property before distributing your source code; it should be left outside of your version control system.
Go to Tools->SDK Manager (or Files->Settings->Appearance & Behavior->System Settings->Android SDK ). Then select the SDK Tools tab, and check the Show Package Details checkbox. You will see your NDK version.
Try to add the configuration below to your gradle:
externalNativeBuild {
cmake {
version "3.10.2" // here
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With