Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Eclipse, openjdk6 and downloaded and extracted the sdk manager file.

Now, When I created an Android project I got the following error:

2012-06-06 18:44:40 - contactManager] /home/catia/android-sdks/platform-tools/aapt: 
error while loading shared libraries: libz.so.1: cannot open shared object file: 
No such file or directory

And this one when I tried to create an AVD Manager:

[2012-06-06 19:00:18 - SDK Manager] /home/catia/android-sdks/tools/mksdcard: error 
while loading shared libraries: libstdc++.so.6: cannot open shared object file: No 
such file or directory 
[2012-06-06 19:00:18 - SDK Manager] Failed to create the SD card.
[2012-06-06 19:00:18 - SDK Manager] Failed to create sdcard in the AVD folder.
share|improve this question
    
sudo apt-get install libstdc++6-4.6-dev [or search on synaptic with libstdc++ ]. and sudo apt-get install zlib1g-dev –  shantanu Jun 6 '12 at 18:52
3  
@shantanu The problem is not that the header files (-dev packages) are missing, but that the Android SDK needs the 32-bit versions of the libraries. Header files are only needed for building software that relies on a library, not for running pre-built software. –  Eliah Kagan Jun 6 '12 at 19:25

6 Answers 6

up vote 39 down vote accepted

This problem is occurring because the Android SDK is compiled for a 32-bit GNU/Linux system, and your Ubuntu system is a 64-bit GNU/Linux system. The solution should be easy (since Ubuntu fully supports running 32-bit programs on a 64-bit OS)--just install the 32-bit versions of the libraries it needs.

The simplest and easiest way to do this is to install the 32-bit versions of all the most commonly used libraries, by installing the ia32-libs Install ia32-libs package. You can do this in the Software Center or in the Terminal with:

sudo apt-get update
sudo apt-get install ia32-libs

Originally ia32-libs was provided because Ubuntu, in its default configuration, didn't support installing 32-bit Ubuntu packages on a 64-bit system. Now that this is fully supported by default, the ia32-libs package just causes the same 32-bit packages to be installed on your 64-bit system that would be installed on a minimal 32-bit system. (So for anyone who is worried this might not work now that multarch is supported by default: it still works.)

Source: Android/Eclipse Installation on Ubuntu 11.04 - aapt and adb not working properly
See also: Eclipse Android Plugin — libncurses.so.5

share|improve this answer
1  
Thank you!!!! I'm on my way now!! –  csbl Jun 6 '12 at 19:20
9  
This no longer appears to be a solution for Ubuntu 13.10. –  Sahas Katta Oct 20 '13 at 23:04
9  
@SahasKatta this works askubuntu.com/a/165536/1599 –  phunehehe Oct 27 '13 at 7:51
1  
Ubuntu 13.10+ the ia32-libs have been replaced by lib32z1, lib32ncurses5, and lib32bz2-1.0 (mesage provided when you try to install ia32-libs). lib32stdc++6 is not included in this list but is also required. –  RBI Jun 29 at 16:13
1  
This answer lead me to what worked for me: "sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0" –  cjstehno Sep 20 at 1:00

If you are using Debian Jessie (or Ubuntu 13.10+), try

sudo apt-get install lib32stdc++6

share|improve this answer
    
It work well for ubuntu 13.10 64 bit –  Tamil Selvan Nov 17 '13 at 15:12
    
Just solved the same problem for me on Linux Mint 16 RC. –  Trevor Nov 21 '13 at 22:35
2  
worked for me on brand-new Ubuntu 14.04. thanks a lot! –  talha06 Apr 18 at 1:50

This thread was the fix for me.

Specifically, installing this package:

sudo apt-get install lib32z1 lib32z1-dev
share|improve this answer
    
None of the answers, except this one, worked for me. Thanks :) –  codeMan Jan 2 at 17:00
    
I'm getting a lot of rep for this answer ... thanks ... somehow user 'Squeezle' changed my answer so what is above is not my original post. -1 to the site for allowing my response to be changed by whomever, but +1 to squeezle for posting what looks like a popular answer. –  ether_joe Jul 25 at 18:23

This works for me: aptitude install lib32stdc++6

share|improve this answer

I just ran into this on Ubuntu 14.04 64-bit. My solution was:

sudo apt-get install -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386

Based on the shared libraries required for the aapt tool:

$ readelf -d android-sdk-linux/build-tools/20.0.0/aapt | grep -i shared
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libz.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
share|improve this answer
    
Thanks. This worked for me (Ubuntu 14.04 x64). The others donn't. –  Juanin Jul 28 at 20:10
sudo apt-get install lib32z1

This worked for me.

Go to synaptic --> Search for lib32z1 --> select both runtime and development Apply and u r done.

share|improve this answer

protected by Community Jul 17 '13 at 15:32

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.