I have set up my Android project on Jenkins and it's working most of the time. But from time to time the build can't complete.
The stacktrace gives me this :
Exception in thread "png-cruncher_1" 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:722)
And this exception repeats like 20 times, with "png-cruncher_2", "png-cruncher_8", "png-cruncher_4", "png-cruncher_3"... and then nothing.
I used to abort the build manually and finally configured the job to abort after 10 minutes. If I launch the build again, it usually works.
I upgraded build tools version (currently 22.0.1) but it didn't help. Builds are working fine on my computer so I guess it comes from the server where Jenkins is running, but I can't figure out what's wrong.
Does anyone have any idea what the problem could be ?
EDIT : Jenkins is installed on a PC with Windows