AICamera icon indicating copy to clipboard operation
AICamera copied to clipboard

Error occurred while communicating with CMake server.

Open xwzy opened this issue 6 years ago • 4 comments

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 avatar Jan 23 '19 10:01 xwzy

Searched all related problems and did not fix it.

xwzy avatar Jan 23 '19 11:01 xwzy

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

buptlihang avatar Jan 31 '19 14:01 buptlihang

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

pedrodiamel avatar Feb 15 '19 00:02 pedrodiamel

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"
        }
    }

mgarbade avatar Jul 18 '19 12:07 mgarbade