Exception in thread "png-cruncher_x" [duplicate] - android

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)

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

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

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.

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.

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.

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.

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.

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.

I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force

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.

Downgrading Build Tools rescued me.

Related

installing android studio on ubuntu

everybody, I am the android developer, I am using ubuntu 14.04 LTS.
Because of some hardware problem, I have to format my PC. before that android studio , SDK and Java were working perfectly.
After formatting my PC. I installed jdk1.8.0_71. after i extract android studio deb file with command sudo dpkg -i android-studio_4.13.0-ubuntu0_all.deb
and 'android-studio' folder extracted at /opt directory.
after that, i try to run /opt/android-studio/bin/studio.sh with command.
sh ./studio.sh and it gives me error like this
I have also tried by ./studio.sh to execute but same error. please help to solve.
To install Oracle Java on Ubuntu, do this:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
I do this every time I install an Android Studio and it works flawlessly. And your Java 8 will be kept up to date, too. The environment variables are automatically properly set by that procedure.
its all about ELF execution (when you get bushes in output)
when your 64 bit os tries to start the Android SDK which in turns tries to run some 32 bit binaries and thus is the issue of compatibility.
check you have proper libs installed for studio
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
64-bit architecture your you need
sudo apt-get install libncurses5:amd64 libstdc++6:amd64 zlib1g:amd64
and 32 bit:
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
for details see:
https://developer.android.com/studio/install.html
ps if apt could not find such libs try to search for similar - the name can vary for different distro
also use proper java hotspot (jdk) 32/64bit for your system
Setting up Android Studio takes just a few clicks.
While the Android Studio download completes, verify which version of the JDK you have: open a command line and type javac -version. If the JDK is not available or the version is lower than 1.8, download the Java SE Development Kit 8.
To install Android Studio on Linux, proceed as follows:
Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
Tip: Add android-studio/bin/ to your PATH environment variable so you can start Android Studio from any directory.
Select whether you want to import previous Android Studio settings or not, then click OK.
The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.
Note: 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 lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
For your details:
https://storage.googleapis.com/androiddevelopers/videos/studio-install-linux.mp4
I had similar problems with finding java by starting android-studio on ubuntu.
I solved the problems by editing the studio.sh file.
In the file the JAVA_HOME variable should be set, but it wasn't.
So I set the JAVA_HOME variable in the script manually and I could start android-studio.
Finally i solved my problem bu reinstalling java properly. i thought i installed wrong java/jdk. now Android Studio,Java is working.
I found this link useful to install java step by step. Link to install java step by step
Install Android Studio in ubuntu :
At first install JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
Download the android studio from here
https://developer.android.com/studio
Unzip android studio tar file using :
sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
or Simply unzip the download file using Archive Manager
Goto to android-studio/bin folder and open terminal or in terminal type
/opt/android-studio/bin
Then type :
./studio.sh
Android studio lunch your computer.
It takes about 30 min to one hour to finish gradle.
There recommend some updates and you should provide those updates.
For installing app using your phone, open developer mode. If you cannot see developer options go to about phone and tap build version 8 times.
In developer options turn on usb debugging.
Connect the phone into the computer using a USB cable.
Give a commands : sudo apt install adb
On the phone there is a dialog for debugging permission. Provide the permission.
Then install the app.
For saw the program in desktop goto tools->Create Desktop Entry-> Ok
Please, try to install java 7 or openjdk. It must solve problem.

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)
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
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).
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.
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.
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.
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.
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.
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.
I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force
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.
Downgrading Build Tools rescued me.

Android SDK Issues Ubuntu 10.04lts

I have looked through the other questions on here, and on other forums. The answers didn't help my issue. I originally started out with 11.10 but thought there could be a bug or something that was stopping it from working. I have had the SDK and ADT working with Eclipse on both 10.04 and 11.10 so I really am at a loss as to what is going wrong.
The error I get is as follows:
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534)
Missing requirement: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.ui 3.6.2' but it could not be found
When I ran the SDK install a second time (after uninstalling it) I noticed the following error:
Stopping ADB server failed (code -1).
Unable to run 'adb': Cannot run program "/home/ben/android-sdk-linux/platform-tools/adb": java.io.IOException: error=2, No such file or directory.
Starting ADB server failed (code -1).
I didn't see it there the first time and I don't know what it means or how to fix it!
Any help would be greatly appreciated, the other 'answer' I found was from the same person who asked the question, that reinstalling everything corrected the problem, I have not been so fortunate so I thought I would re-raise the query. Thank you in advance. I am using Indigo as the version, I saw elsewhere that Helios was the lowest that could use the SDK.
Gone back to 11.10 but the issue remains the same, the laptop is a Samsung R580 64bit.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 10
Installing Android SDK Platform-tools, revision 10
Stopping ADB server failed (code -1).
Still appears when installing the SDK Tools using the following command from terminal:
android-sdk-linux/tools/android
You're problem is entirely different than the one posted by robertly, although I'm sure you've found it using google.
You're running 64bit ubuntu and forgot to run the following command.
apt-get install ia32-libs
The phones aren't 64bit, so there is no 64bit version of adb. You need the ia32-libs.
After this is done, open eclipse and go to
Windows -> Android SDK Manager
then, uninstall all the tools(under tools sub folder) and reinstall them.
You should no longer get the adb error.
Source:
http://developer.android.com/sdk/installing.html#troubleshooting
Solution #2 - I had to do this because sudo apt-get remove eclipse didn't remove it completely and it still cause errors. Doing all of this, combined with the step above solved my problem the other night.
Delete eclipse, android folders
sudo apt-get remove eclipse
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo update-alternatives --config java
Reinstall eclipse 3.7.1, android-sdk-linux folder
Proceed with normal installation.
Head on over here, it looks to be the same problem, but with a different package.
Eclipse Indigo - Cannot install Android ADT Plugin
This is assuming you haven't seen that yet. If you are still having problems, I can look into it further for you.

Failed to parse the output of 'adb version'

I'm using Ubuntu 11.10 and Eclipse for android developing. I've already made a new project, but it contains error:
Failed to parse the output of 'adb version'
I will be thankful if anyone have an idea how can I fix that?
Install Oracle JRE using PPA:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Install ia32-libs from software center.
Two options to solve this problem on windows:
Option 1:
Close the eclipse, if it is running.
Run the command prompt.
Go to the tools location of the android sdk.
run 'adb kill-server'
then run 'adb start-server'.
start the eclipse.
Option 2:
Open the task manager.
kill the adb process.
start the eclipse.
Problem should be solved.
The official Android SDK only runs on i386 JVM, so you need to manually specify the i386 JVM on Eclipse.
First install the Sun(Oracle) 32-bit JVM. Here is a step-by-step on how to do this:
Add the JVM to Eclipse. Navigate:
Window > Preferences > Java > Installed JREs > Add
Put the location of the JVM. Probably will be /usr/lib/jvm/java7/ (my is /usr/lib/jvm/java-7-sun-1.7.0.01). The external libraries will be automatically added when you put the location of the JVM.
Set the Sun (Oracle) 32-bit JVM as default.
if you run eclipse immediately after installing your java JDK, the java virtual machine MIGHT not be properly started. you will receive this error code when launching eclipse.
first check if when you installed your JDK, you copied a script file
/etc/init.d/jexec
if you did, before you do anything fancy, reboot your machine so that jvm starts properly. if you didnt, please decompress your jdk rpm file and extract the contents properly and then reboot.
worked for me, i just had this problem while installing adt bundle (and java jdk) on a virgin install of ubuntu 12.04 on a 64bit machine.
Delete the platform tools and then re-install them from the SDK manager
Copy the sdk\platform-tools contents to sdk\tool
also you must have a JAVA_HOME env var pointing to your java location
ex. JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21

aapt not found under the right path

I just updated ADT, than the SDK and now I have in only one project the issue, that my aapt isn't found
Error executing aapt. Please check aapt is present at /opt/android/platform-tools/aapt
The path is correct, I checked twice and more times.
-rwxrwxrwx 1 martin martin 3,5M 2010-12-08 10:41 /opt/android/platform-tools/aapt
I can start aapt via console, the permissions are 777, I restarted eclipse, closed/reopened the project, restarted adb and finally my Ubuntu.
Some ideas why this might happen only at one project?
It seems that cleaning this specific project doesn't work but cleaning all open project does the trick.
I leave this question if someone else get this issue.
I found that this could be fixed by installing the ia32-libs package as the Android sdk requires 32-bit libraries.
I solved this problem by adding a / after my android-sdk path in...
Eclipse->preferences->android->SDK Location:
The aapt location has been changed recently. You can find it under:
/path/to/adt/sdk/buid-tools/android-[version]/aapt
In the terminal execute this command :
chmod a+x platform-tools/aapt
it solved the problem for me
(in 64bit you have to install ia32-libs with this command : sudo apt-get install ia32-libs)
Check you have Android SDK version required installed and the path in Eclipse->preferences->android->SDK Location is correct.
Check file permissions. Run:
chmod a+x aapt
If you are using Linux 64-bits. You'll see this hint:
Hint: On 64-bit systems, make sure the 32-bit libraries are installed: sudo apt-get install ia32-libs line 1 Android ADT Problem
To fix it, you'll have to install 32-bits libraries:
sudo apt-get install ia32-libs
or
sudo apt-get install lib32z1
Maybe you'll need to install other libraries (libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386) or the emulator (libsdl1.2debian:i386). In my case it was enough installing libstdc++6
sudo apt-get install lib32stdc++6
For more information you can check this question:
How to resolve Error executing aapt in Android/Eclipse?
Starting build-tool 23, aapt has been moved under the ./bin directory
waiting for Eclipse ADT to be updated , one can just create a symbolic link to aapt
cd <path_to_your_android_sdk_folder>/build-tools/23.0.0_rc1
ln -s ./bin/aapt aapt
this will create a symlinc
<path_to_your_android_sdk_folder>/build-tools/23.0.0_rc1/aapt
pointing to actual aapt tool laying here
<path_to_your_android_sdk_folder>/build-tools/23.0.0_rc1/bin/aapt
and eclipse will be able to build android project back again :-)
My issue with aapt got solved by simply chmod a+x platform-tools/aapt
Following did the trick for me. Had to do the build dep as some of the lib dependencies were missing.
sudo apt-get install lib32z1
sudo apt-get build-dep lib32z1
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
Restart eclipse
I didn't collide with this problem, but if you have ADT 8 revision or later, so you should read it's dependencies better: "ADT 8.0.0 is designed for use with SDK Tools r8. If you haven't already installed SDK Tools r8 into your SDK, use the Android SDK and AVD Manager to do so." (http://developer.android.com/sdk/eclipse-adt.html)
I've run into this problem constantly and can not get R to be resolved to a variable after making projects clean, in addition to not being able to find aapt -
Error executing aapt. Please check aapt is present at C:\AndroidSDK\android-sdk-windows\platform-tools\aapt.exe
None of the suggestions on this page make any sense or have helped in anyway. I'm using nothing but API 8 onwards.
I solved this problem by checking 'build automatically' under project menu.
I have faced the same problem after updating the SDK. I find out that the AUTOGENERATE folder doesn't have any file. What I done is :
WINDOWS->ANDROID SDK MANAGER:
rollback the SDK version to 16
Install all the tool provided.
SDK TOOLS (Version 16)
Platform Tools
install the SDK 4.0
Restart the eclipse
It solved!
For me, the problem was that Eclipse 4.4 was looking for aapt without "bin/" at the end of the path.
Since I could not find a way to configure this path, I symlinked the aap executable from the "bin" subdirectory to the "23.0.0_rc1" directory one level higher. This works now.

Categories

Resources