[android] libz.so.1: cannot open shared object file

I am facing an issue on ubuntu 12.04 as :

/usr/lib/ndk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

I tried

sudo apt-get install lib32z1

But it says

Reading package lists... Done Building dependency tree Reading state information... Done lib32z1 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 610 not upgraded.

Please suggest a solution.

This question is related to android ubuntu ubuntu-12.04 android-sdk-tools

The answer is


for centos, just zlib didn't solve the problem.I did sudo yum install zlib-devel.i686


After checking to which package does the libz.so.1 belongs (http://packages.ubuntu.com/lucid/i386/zlib1g/filelist) you should try to install zlib1g:

sudo apt-get install zlib1g

As pointed by @E-rich, it may be required to add a :i386 suffix to the package name for the package manager correctly identify it:

sudo apt-get install zlib1g:i386


EDIT (for CentOS or other distro that makes use of yum):

If someone using CentOS (or any other distro that makes use of yum) that may end up reading this question, @syslogic proposed the following solution in the comments:

yum install zlib.i686

or, for 32-bit binaries:

yum install zlib.i386

For Arch Linux, it is pacman -S lib32-zlib from multilib, not zlib.


For Fedora (can be useful for someone)

sudo dnf install zlib-1.2.8-10.fc24.i686 libgcc-6.1.1-2.fc24.i686


I've downloaded these packages:

  • libc6-i386
  • lib32stdc++6
  • lib32gcc1
  • lib32ncurses5
  • zlib1g

I then unpacked them and added the directories to LD_LIBRARY_PATH in my ~/.bashrc. Just make sure to add proper dirs to the path.


This worked for me

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5


Check below link: Specially "Install 32 bit libraries (if you're on 64 bit)"

 https://github.com/meteor/meteor/wiki/Mobile-Dev-Install:-Android-on-Linux

sudo apt-get install zlib1g:i386 fixed the Gradle issue on Android 2.1.1 on Xubuntu 16.04.


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found

Examples related to ubuntu-12.04

Increasing Heap Size on Linux Machines wget: unable to resolve host address `http' How to check which PHP extensions have been enabled/disabled in Ubuntu Linux 12.04 LTS? java.lang.Exception: No runnable methods exception in running JUnits Speed up rsync with Simultaneous/Concurrent File Transfers? MySQL Job failed to start CronJob not running libz.so.1: cannot open shared object file error: could not create '/usr/local/lib/python2.7/dist-packages/virtualenv_support': Permission denied Package doesn't exist error in intelliJ

Examples related to android-sdk-tools

"Failed to install the following Android SDK packages as some licences have not been accepted" error Flutter does not find android sdk Failed to run sdkmanager --list with Java 9 You have not accepted the license agreements of the following SDK components Automatically accept all SDK licences Android SDK location should not contain whitespace, as this cause problems with NDK tools Finding Android SDK on Mac and adding to PATH Android SDK folder taking a lot of disk space. Do we need to keep all of the System Images? Daemon not running. Starting it now on port 5037 libz.so.1: cannot open shared object file