最近按捺不住升级了一下android sdk,果然入坑了,幸亏本人习惯性的将之前能用的那一套Android Studio以及Android SDK备份了,否则呵呵
首先,升级Android SDK后,对于普通的纯java或者纯kotlin的Module来说,没有任何异常,但是一旦有Module使用了ndk和cmake,那么在Sync Project with Gradle Files
的时候就会报错:
SIMPLE: Error configuring
实际如下图所示
Sync Module included C Error当我们直接AssemDebug的时候,会包如下错误,以至于编译不通过
[== "CMake Server" ==[
{"cookie":"","inReplyTo":"configure","message":"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.","title":"Error","type":"message"}
]== "CMake Server" ==]
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 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 Server" ==[
{"cookie":"","errorMessage":"Configuration failed.","inReplyTo":"configure","type":"error"}
]== "CMake Server" ==]
Configuration failed.
External native generate JSON for5520Debug: JSON generation completed with problems
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Xxxxx'.
> executing external native build for cmake D:\Projects_path\Module_path\CMakeLists.txt
实际如下图所示
提示Ninja错误 提示executing external native build for cmake错误
感谢我有升级前备份的习惯,很快定位到了问题的所在,现阶段网上遇到 Ninja
错误的非常多,但是貌似还没有遇到是因为升级android sdk出现这个错误的解决思路
如此,便有了解决办法:将cmake的版本降回去
升级版本之前,我的CMake版本是3.6.4111459
升级之前SDK Manager提示我升级到3.10.2
升级后的详细版本如下
CMake升级到3.10.2版本比较一下这两个版本的内容
两个CMake版本比较
看图说话,就问Google,你坑不坑?
网友评论