Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)
like image 651
Carson English Avatar asked May 07 '15 20:05

Carson English


4 Answers

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
like image 108
Raul Caceres Avatar answered Nov 04 '22 00:11

Raul Caceres


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).

like image 44
Luke Beveridge Avatar answered Nov 03 '22 23:11

Luke Beveridge


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.

like image 3
ianribas Avatar answered Nov 04 '22 01:11

ianribas


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.

like image 3
Flávio Filho Avatar answered Nov 04 '22 00:11

Flávio Filho