具体见上图,主要三类
- cmake 找不到
- ndk找不到,更新as 3.5.3以后特有的,
- 安装失败
1 cmake找不到
报错:
CMake Error: CMake was unable to find a build program corresponding to “Ninja”.
CMake Error: CMake was unable to find a build program corresponding to “Ninja”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
解决方法
- cmake添加到环境变量中,
- 工程中手工指定, cmake.dir =
2 ndk找不到
报错:
NDK Resolution Outcome: Project settings: Gradle model version=4.4, NDK version is UNKNOWN
android studio版本3.5.3,gradle 4.4,gradle插件3.1.3。使用ndk.dir指定自己的ndk,或者用sdk manager中推荐的ndk版本都报上面的错误。。
解决方法:
升级gradle组件,
The problem is solved when I updated the Android Gradle Plugin Version from 3.1.4 to 3.4.0 and the Gradle Version from 4.4 to 5.1.1 at the same time. Of course, I downloaded the newest NDK(Side by Side) with SDK manager.
3 build ok,安装报错
错误信息:
Cause: buildOutput.apkData must not be null
解决方法:
检查build Variants中的配置,诸如这种:
这里得对齐:
- 很多主流型号的大屏手机都是arm64-v8a了,
- 车机比较旧是arme-v7a,
- android studio也推出了高性能的x86模拟器。
ref
https://stackoverflow.com/questions/57609738/ndk-resolution-outcome-project-settings-gradle-model-version-5-4-1-ndk-versio