출처
: http://stackoverflow.com/a/31095817
: http://stackoverflow.com/a/35373926
Q) 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)
A-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
A-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.
A-2)
https://gist.github.com/ksc91u/37513796b2cec37bb3c5
See the comments in this gist to find locations to put this file.
- Rename aapt to aapt.20
- Copy aapt from tools version 17 to aapt.17
- Put this gist as aapt chmod +x
aapt malformed 9 patch image : https://gist.github.com/ksc91u/f167a7d56e0c2646c9c8 #!/bin/bash enable pwd args=("$@") DIR="$(cd "$(dirname "$0")" && pwd)" case "${args[@]}" in *".9.png"*) $DIR/aapt.17 $@ ;; *) $DIR/aapt.20 $@ ;; esac aapt ERROR: 9-patch image malformed : https://gist.github.com/ksc91u/37513796b2cec37bb3c5 #!/usr/bin/perl # Fix the following error, using gradle or Android Studio to build some projects with malformed 9 patch image # # aapt ERROR: 9-patch image malformed # Frame pixels must be either solid or transparent (not intermediate alphas). # # put the file as sdk/build-tools/20.0.0/aapt and original aapt as aapt.20 # put the file as sdk/build-tools/17.0.0/aapt and original aapt as aapt.17 # force use aapt cruncher by adding: # android.aaptOptions.useAaptPngCruncher = true # in your build.gradle use Cwd 'abs_path'; use Getopt::Long; use File::Copy; $argv = join(" ", @ARGV); @args = @ARGV; if($argv=~m/\.9\.png/){ $aapt = abs_path($0).".17"; #old aapt does not check 9 patch image exec($aapt, @args); } else { $aapt = abs_path($0).".20"; exec($aapt, @args); } |
'IT_Programming > Dev Tools' 카테고리의 다른 글
[펌] Atlassian JIRA를 이용한 프로젝트 관리 (기초편) (0) | 2015.07.15 |
---|---|
Mac에서 Android Studio를 완전히 제거하기 (0) | 2015.05.21 |
Eclipse Kepler Android NDK 경로 설정하기! (0) | 2015.05.04 |
[펌_안드로이드 스튜디오] 어플리케이션 서명(signing) 및 배포, 그리고 debug용 keystore 만들기 (0) | 2015.04.14 |
[Gradle] Gradle 사용자 가이드 번역! (0) | 2015.04.10 |