错误:与CMake服务器通信时发生错误 [英] Error:Error occurred while communicating with CMake server
问题描述
我正在尝试从Windows 10上的Android Studio 3.0构建一个简单的本机应用程序。当我尝试构建该应用程序时,出现以下错误:
I'm trying to build a simple native app from Android Studio 3.0 on Windows 10. When I will try to build the app, I get the following error:
错误:与CMake服务器通信时发生错误。请检查日志xxx\Native\app.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt以获取更多信息。
"Error:Error occurred while communicating with CMake server. Check log xxx\Native\app.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt for additional information."
并且日志包含:
CMAKE服务器:
CMAKE服务器:[== CMake服务器 == [
CMAKE服务器:{ supportedProtocolVersions:[{ isExperimental:true, major:1, minor :1}], type: hello}
CMAKE服务器:] == CMake服务器 ==]
"CMAKE SERVER: CMAKE SERVER: [== "CMake Server" ==[ CMAKE SERVER: {"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"} CMAKE SERVER: ]== "CMake Server" ==]"
我已经按照官方文档的要求创建了 CMakeLists.txt。
I have created the "CMakeLists.txt" as required in the official documenation..
关于如何解决此问题的任何建议?
谢谢!
Any suggestions on how to fix this problem? Thank you!
推荐答案
实际上,问题是Gradle将cmake-server的调试输出解释为错误并失败。它发生在 com.android.tools.build:gradle:3.0.0
上,但它从 com.android.tools.build:gradle开始可以正常工作:3.1.0
。
Actually the issue is that Gradle is interpreting the debug output of the cmake-server as an error and fails. It happens with com.android.tools.build:gradle:3.0.0
but it works correctly starting with com.android.tools.build:gradle:3.1.0
.
如果由于某种原因(插件等)而无法更新至3.1.0,则可以替换 cmake
和一个python包装器,并通过删除以下确切输出来过滤输出:
If for some reason (plugin, etc) you cannot update to 3.1.0, you can replace cmake
with a python wrapper and filter the output by removing this exact output:
[== "CMake Server" ==[
{"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}
]== "CMake Server" ==]
这篇关于错误:与CMake服务器通信时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!