今天在ubuntu下使用android studio时,gradle运行一直卡在“Gradle Build Running”,看了下控制台,一排错误日志:
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)
原因是,我是64位的系统,当然as也是64位的,系统缺少32位的相关依赖库。
打开终端依次运行以下命令,重启as即可解决。
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
Gradle关于Daemon的配置:http://www.linuxdiyf.com/linux/16598.html
Ubuntu Linux14 64位下在Android studio下用gradle编译Andrid项:http://www.linuxdiyf.com/linux/15932.html
ubuntu中执行gradle提示JAVA_HOME错误:http://www.linuxdiyf.com/linux/15775.html