Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Error occurred while communicating with CMake server. #72

Open
xwzy opened this issue Jan 23, 2019 · 4 comments
Open

Error occurred while communicating with CMake server. #72

xwzy opened this issue Jan 23, 2019 · 4 comments

Comments

@xwzy
Copy link

xwzy commented Jan 23, 2019

NDK r16b
Gradle 4.1
Cmake 3.10
MacOS 10.14.2
Android studio 3.2.1

When I build the project, get error

Error occurred while communicating with CMake server.
@xwzy
Copy link
Author

xwzy commented Jan 23, 2019

Searched all related problems and did not fix it.

@buptlihang
Copy link

I got the same issue. I downgrade the CMake to 3.6 and it works for me.

@pedrodiamel
Copy link

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.1 but it works correctly starting with com.android.tools.build:gradle:3.1.0.

It works for me:


/// (1) build.gradle file

diff --git a/build.gradle b/build.gradle
index 5120095..d17925d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.3.1'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

/// (2) gradle/wrapper/gradle-wrapper.properties file

diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index c18d9e9..c14b620 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Mar 06 19:43:14 PST 2018
+#Thu Feb 14 18:28:03 EST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

@mgarbade
Copy link

mgarbade commented Jul 18, 2019

The trick mentioned by @pedrodiamel removes the above mentioned CMake error. However now the Android Studio runs into a new error:

External Native Build Issues:
    SIMPLE: Error configuring

whatever this means ...

(Im using Android Studio 3.4.1 and downloaded and linked android-ndk-r17c-linux-x86_64 in local.properties as described in different issues.)

*UPDATE: The latter problem can be fixed with this trick:

  • Step 1: Open build.gradle
  • Step 2: Delete this portion of code from the file and rebuild the project
externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
        }
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants