Android Studio 3.0 - No server to serve request

2020-01-25 10:51发布

After clean install of Android Studio I always get the error

Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.

and

Error:Execution failed for task ':Application:mergeDebugResources'. Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.

Java is up to date and the path is set.

I am new to Android Studio, what should I try?

14条回答
▲ chillily
2楼-- · 2020-01-25 11:13

For me, this is the side effect of another issue that I haven't root caused yet. Every once in a while, I get aapt2 failures because some file /tmp/ld-linux-x86-64.so.2 is "busy", with the following error message.

AAPT err(Facade for 1745790725): cp: cannot create regular file '/tmp/ld-linux-x86-64.so.2': Text file busy
Slave 1745790725 failed to start java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at ~/.../android-sdk-linux/build-tools/27.0.3/aapt2) are not corrupted.

When this happens I just rm that file and everything starts working again. I suspect this might be caused by me actually having two installs of adb (one through ubuntu via apt and one from Android studio) but I haven't had time to dive deeper.

查看更多
Evening l夕情丶
3楼-- · 2020-01-25 11:15

We ran into the same issue, and have been able to find the root cause: The error message means that Gradle cannot connect to some worker processes. In our case, the process was for 'aapt2'. Running 'ldd aapt2' indicated that some shared libraries were missing (mainly GLIBC). Since we're using Docker based on Alpine Linux, it comes with a reduced GLIBC (glibc-musl). The solution was to simply install glibc in the Docker container.

I suggest you run ldd build-tools/{version}/aapt2 to see which libraries are missing from the OS. You did not mention your OS, are you also using Docker and AlpineLinux ?

查看更多
登录 后发表回答