Android Studio 3.0 - No server to serve request

匿名 (未验证) 提交于 2019-12-03 08:33:39

问题:

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?

回答1:

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 ?



回答2:

In my case, I did not need to re-download the sdk. I closed Android Studio and ran the following command in the Terminal:

sudo chmod 777 -R ~/Desktop/AndroidStudio 

...where, ~/Desktop/AndroidStudio was the folder structure after Root which I needed to mention in order to provide permission to read all the SDK packages and perform required operation as and when necessary by the Android Studio, because my Sdk folder was inside "~/Desktop/AndroidStudio".

I am running Android Studio 3.0.1 on Ubuntu 16.04 LTS. This worked for me perfectly :-)



回答3:

Had to uninstall Android studio and delete the following SDK folder in AppData folder Delete .gradle folder delete .AndroidStudio Projects folder

and did a fresh install which solved .



回答4:

This error occurred because you might have accidentally remove the executable flag from aapt2 which is located in $ANDROID_HOME/build-tools/27.0.2.

Try this:

  • Re-download the sdk (recommended)

followed by-

  • sudo chmod 777 -R $ANDROID_HOME

Note: $ANDROID_HOME is the location where I put android sdk

Hope this helps !!



回答5:

If it is possible for you, please delete the build folder of project and test building android project with any other version of build-tools.

in my case, build-tools version: 26.0.2 had problem, I tested with 27.0.3 and it solved my problem unbelievably :)



回答6:

I had this problem on lubuntu-16 32bit (and also some other problems too). all of the problems were solved when I updated my system to lubuntu-16 64-bit.



回答7:

If you are on Windows 10 (sigh), close android studio and then right click on android studio icon and select 'Run as Administrator' from 'more' menu.

Build again.



回答8:

You can run Android Studio as Admin.

I hope it will help you.

To Do So :

  1. Right click
  2. choose Run as Administrator

Best regards,



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!