Ubuntu Linux14 64-bit under Android Studio under the Gradle compile Andrid project, there is a workaround that Libz.so.1 shared library cannot find.

Source: Internet
Author: User

---restore content starts---

I installed the as under UBUNTU14 64, but I always reported that I couldn't find the libz.so.1 error when I compiled the project with Gradle.

Error while loading shared librarieserror while loading shared libraries:: Libz.so.1libz.so.1:: Cannot open shared objec T Filecannot open Shared object file:: No such file or directoryno such file or director

The above is the reported error, indicating that the shared library could not be found.

The following uses the Apt-file command to search for this file, first if the system does not install the command to install first:

sudo apt-get install Apt-file

You may be prompted to update

sudo apt-file update

To search using a command:

sudo apt-file search libz.so.1

Results from my system:

LIB32Z1:/usr/lib32/libz.so.1
LIB32Z1:/usr/lib32/libz.so.1.2.8
LIBX32Z1:/usr/libx32/libz.so.1
LIBX32Z1:/usr/libx32/libz.so.1.2.8
ZLIB1G:/lib/x86_64-linux-gnu/libz.so.1
ZLIB1G:/lib/x86_64-linux-gnu/libz.so.1.2.8

At the beginning I entered the/USR/LIB32, but did not find libz.so.1 this file, although found out, but did not see there.

As for/usr/libx32, I TMD even this directory can not open, hint does not exist, OK, Linux novice, a lot of do not understand.

Then I entered the/lib/x86_64-linux-gnu/directory, found that libz.so.1 is just a link file, the link is libz.so.1.2.8, well, no matter how much,

Copy the libz.so.1.2.8 to the build-tools/lib/directory in the SDK, and of course the name is best changed to libz.so.1. (In fact, you can also use soft links, but I see some netizens on the internet that there is a problem with soft links, well, the novice or insurance low, first to solve the problem in said other. )

And then compile with AS, in the log still have errors, but the error becomes unable to use the current 64-bit shared library, it seems that the SDK is only 32 bits, so 64-bit shared library can not be used, well, it appears that only 32-bit is used.

Use the command:

sudo apt-get install lib32z1

Be sure to sudo. Then in the/usr/lib32 directory down to see the libz.so.1.2.8 this file, OK, copy this file or link to build-tools/lib/under it.

Took me a day, in fact, is not a complex thing, can only say that Baidu really sucks.

Reference: http://www.th7.cn/system/lin/201503/95956.shtml

---restore content ends---

Ubuntu Linux14 64-bit under Android Studio under the Gradle compile Andrid project, there is a workaround that Libz.so.1 shared library cannot find.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.