53

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. 
2
  • sudo apt-get install libstdc++6-4.6-dev [or search on synaptic with libstdc++ ]. and sudo apt-get install zlib1g-dev Commented Jun 6, 2012 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. Commented Jun 6, 2012 at 19:25

8 Answers 8

55

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

sudo apt-get install lib32stdc++6

3
  • It work well for ubuntu 13.10 64 bit Commented Nov 17, 2013 at 15:12
  • Just solved the same problem for me on Linux Mint 16 RC. Commented Nov 21, 2013 at 22:35
  • 3
    worked for me on brand-new Ubuntu 14.04. thanks a lot! Commented Apr 18, 2014 at 1:50
46

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

5
  • 11
    This no longer appears to be a solution for Ubuntu 13.10. Commented Oct 20, 2013 at 23:04
  • 10
    @SahasKatta this works askubuntu.com/a/165536/1599 Commented Oct 27, 2013 at 7:51
  • Read @SahasKatta comment before console shot. Commented Jun 22, 2014 at 12:43
  • 3
    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. Commented Jun 29, 2014 at 16:13
  • 3
    This answer lead me to what worked for me: "sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0" Commented Sep 20, 2014 at 1:00
36

This thread was the fix for me.

Specifically, installing this package:

sudo apt-get install lib32z1 lib32z1-dev 
4
  • 1
    None of the answers, except this one, worked for me. Thanks :) Commented Jan 2, 2014 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. Commented Jul 25, 2014 at 18:23
  • Only one that worked for me on Ubuntu 14.04 64bit. Thank you! Commented Mar 18, 2015 at 21:57
  • Works perfectly on Debian 8.1.0. I already had lib32stdc++6 so I knew this wasn't the issue. Thanks again! Commented Sep 6, 2015 at 11:13
16

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] 
1
  • 3
    Thanks. This worked for me (Ubuntu 14.04 x64). The others donn't. Commented Jul 28, 2014 at 20:10
7

This works for me: aptitude install lib32stdc++6

1
  • This also eliminated a ton of R related errors for me. Commented Nov 8, 2015 at 10:09
2
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.

2

For Ubuntu >= 13.04 instead of ia32-libs you need libgl1-mesa-dev:i386

sudo apt-get install libgl1-mesa-dev:i386 

Check Complete Installation Guide for Android SDK / ADT Bundle on Ubuntu

2

For Ubuntu 15.04, the following was necessary:

sudo apt-get install lib32stdc++6 lib32z1 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.