Error: An error occurred while communicating with the CMake server

I am trying to create a simple native application from Android Studio 3.0 on Windows 10. When I try to create an application, I get the following error:

"Error: An error occurred while communicating with the CMake server. For more information, see the xxx \ Native \ app.externalNativeBuild \ cmake \ debug \ armeabi-v7a \ cmake_server_log.txt log.

And the magazine contains:

"CMAKE SERVER: CMAKE SERVER: [==" CMake Server "== [CMAKE SERVER: {" supportedProtocolVersions ": [{" isExperimental ": true," major ": 1," minor ": 1}]," type " : "hello"} CMAKE SERVER:] == "CMake Server" ==] "

I created "CMakeLists.txt" as required in the official documentation.

Any suggestions to fix this problem? Thanks!

+8
source share
4 answers

I had the same problem. It worked for me.

Open SDK Manager β†’ Android SDK β†’ SDK Tools -> CMake.

And install CMake from the SDK manager. Just check the images if you don't get what I mean.

enter image description here

enter image description here

+2
source

I got exactly the same error, even with a solution from kevvex, android studio reported the same error.

I compared windows 10 with another running machine and found three differences:

  1. CMake 3.10xxx does not work on my machine, CMake 3.6.4111459 on a working machine

  2. OpenCV-android-sdk version 2.4.7.2 does not work on my machine, OpenCV-android-sdk version 3.2.0 on a working machine

  3. Android-ndk / ndk-bundle 14.1.3816874 does not work on my machine, android-ndk / ndk-bundle r15c on a working machine (this may be optional)

Replacing these three elements, the project was successfully built on my machine.

0
source

Change Gradle version to 3.2

0
source

Actually, the problem is that Gradle interprets the cmake server debug output as an error and fails. This happens with com.android.tools.build:gradle:3.0.0 but works correctly starting with com.android.tools.build:gradle:3.1.0 .

If for some reason (plugin, etc.) you cannot upgrade to 3.1.0, you can replace cmake with the python shell and filter the output by removing this exact output:

 [== "CMake Server" ==[ {"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"} ]== "CMake Server" ==] 
0
source

Source: https://habr.com/ru/post/1273526/


All Articles