Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
506 views
in Technique[技术] by (71.8m points)

Android Studio 2020.3.1 (Canary) : Cmake was unable to find a build program corresponding to "Ninja"

I update android-studio to the latest canary build (2020.3.1 Canary 3), but I'm getting the following error:

C/C++ debug|arm64-v8a : CMake Error: CMake was unable to find a build program corresponding to "Ninja"

when trying to build. I have followed the upgrade for gradle that android studio suggests (after upgrading to android studio canary), and have the following in my top level build.gradle:

dependencies {
   ....
   classpath 'com.android.tools.build:gradle:7.0.0-alpha03
}

Furthermore, some relevant parts of my app/build.gradle:

defaultConfig {
    applicationId "com.imerso.scanner"
    minSdkVersion 23
    targetSdkVersion 30
    versionCode gitVersionCode
    versionName gitVersionName
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    externalNativeBuild {
        cmake {
            arguments "-DFOO_DIR=./thirdparty/FOO/cmake", '-DANDROID_STL=c++_shared'
            abiFilters "arm64-v8a", "x86_64"
        }
    }
    kapt {
        arguments {
            arg("room.schemaLocation", "$projectDir/schemas".toString())
        }
    }
}

externalNativeBuild {
    cmake {
        version "3.14.3"
        path file('src/cpp/CMakeLists.txt')
    }
}
ndkVersion = '20.1.5948944'

Also, I have installed ninja-build (using sudo apt install ninja-build), and this used to work with previous versions of android studio.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...