Android Studio相当于是Intellij基础上写了一个AS插件,这个插件使用gradle作为构建系统,因此构建出现问题先考虑gradle的文档。
gradle可以使用native build system,例如cmake。gradle中使用cmake时可以指定cmake版本,官方文档:https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.CmakeOptions.html
使用情景:我在系统中装了一个cmake3.13.4,发现android studio的sdk会去自行为ndk工程下载cmake3.6。我只想用cmake3.13.4。
具体设置:
方法1:/app/build.gradle:
externalNativeBuild {
cmake {
...
// Specifies the version of CMake the Android plugin should use. You need to
// include the path to the CMake binary of this version to your PATH
// environmental variable.
version "