Android Studio fails to build new project, timed out while wating for slave aapt process

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

问题:

I've installed Android Studio 1.2, and created a new project. When I attempt to build, it hangs. This is in the Gradle Console, along with about 20 other copies, with different numbers after png-cruncher_:

Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:104) at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:107) at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204) at java.lang.Thread.run(Thread.java:745)

回答1:

I had the same problem with Debian Jessie for AMD64. I did this, and it works:

sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386


回答2:

I had the same issue whilst running Android Studio 1.5.1 for Windows 8.1 (64 bit), and what I did to solve the problem was by adding the following two system environment variables:

SLAVE_AAPT_TIMEOUT = 30 JAVA_HOME = C:\Program Files\Java\jdk1.8.0_65

(Please note: The path for the JAVA_HOME system environment variable is dependant on where your JDK is located and that the version of your JDK may differ from the example above).



回答3:

I had this problem and what was missing were a library to be installed on the SDK. Just installing the correct library immediately solved the problem. In my case was the Android Support Library, as I was creating a navigation drawer. The errors shown in the gradle console didn't give me a clue for the solution, and didn't helped me at all. Click on SDK manager, and click on the tab SDK Tools, check "Android Support Library" and click apply.



回答4:

I had this problem on Windows 8.1 64 bits and what ended up solving everything was running gradle in the command line in debug mode, on the project folder:

gradlew -d assembleDebug

Running without the -d flag had the same problem.

After running the first time, everything was ok, I could even clean and rebuild my project.



回答5:

If you are running on a Linux x64 machine you probably miss some required libraries. The offical sdk guide states:

Required libraries for 64-bit machines:

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0

If you are running 64-bit Fedora, the command is:

sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686

of course don't forget to

sudo apt-get update

first.



回答6:

This is a known bug reported here --> https://code.google.com/p/android/issues/detail?id=188627

The workaround on Mac is to reboot your computer.



回答7:

I uninstalled 1.2 and installed 1.1, but it did't work.

Because I used local SDK installed previously, I uninstalled and reinstalled 1.1 and installed SDK to new path.

After I used SDK in new path, I don't have those errors any more.

And I upgraded Android Studio to 1.2, and also I don't have errors.



回答8:

Downgrading Build Tools rescued me.



回答9:

By pausing the antivirus I don't have anymore that problem, or better by making a rule at the antivirus in order to accept a given '.class' filename recognized as trojan, then banned at compile-time.



回答10:

Check your firewall if it is coming in your way. Disabling my firewall works for me but i don't know if it's the right fix.



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