我正在构建一个需要一些NDK代码的项目,但这是最近几天我一直为之疯狂的问题。
这只是一个使用NDK的空项目,它是按照AS指南创建的,什么也没做。
环境:
以下是提示:
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
The CompileOptions.bootClasspath property has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the CompileOptions.bootstrapClasspath property instead.
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
[== "CMake Server" ==[
{"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}
]== "CMake Server" ==]
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Error occurred while communicating with CMake server. Check log C:\Users\xxx\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt for additional information.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
CONFIGURE FAILED in 7s
Error occurred while communicating with CMake server. Check log C:\Users\xxx\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt for additional information.
我已经检查了该网站和许多其他网站中的所有帖子。试图重新安装AS / SDK / NDK / gradle / tools ...这些答案都无效。
答案 0 :(得分:0)
我做了与Oliver.Wong类似的事情,并且对我有用。我直接从AndroidStudio卸载了Cmake(我的版本是3.10.xx)。然后我从命令行安装了Cmake 3.6xx(“ yourSdkPath” / android-sdk / tools / bin / sdkmanager /“ cmake; 3.6.4111459”)
答案 1 :(得分:0)
尝试以下
externalNativeBuild {
cmake {
...
version "3.10.2"
...
}
}
或者只是删除较新版本的CMake 3.10.2,然后回退到3.6。
答案 2 :(得分:0)
请查看this one是否可以提供帮助。对于这种情况,请尝试使用Studio / gradle插件版本3.3.1+。