简体   繁体   English

在64位Ubuntu 12.04上运行aapt:加载共享库时出错:libc ++。所以:没有这样的文件或目录

[英]Running aapt on 64-bit Ubuntu 12.04: error while loading shared libraries: libc++.so: No such file or directory

I downloaded the Android Open Source Project and built it on Linux (Ubuntu 12.04 64-bit) using the instructions here: 我下载了Android开源项目并使用以下说明在Linux(Ubuntu 12.04 64位)上构建它:

http://source.android.com/source/building.html http://source.android.com/source/building.html

I can get it to build without a problem. 我可以毫无问题地建立它。 When the build is done, I'm interested in the build tools, particularly aapt. 构建完成后,我对构建工具感兴趣,尤其是aapt。 When I run it, I see this: 当我运行它时,我看到了这个:

awt@aosp-build:/aosp/out/host/linux-x86/sdk/sdk/android-sdk_eng.awt_linux-x86/build-tools/android-5.0.50.50.50.50$ ./aapt
./aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

So, that's strange. 所以,这很奇怪。 Especially considering that libc++.so is right there in the same directory: 特别是考虑到libc ++。so就在同一个目录中:

awt@aosp-build:/aosp/out/host/linux-x86/sdk/sdk/android-sdk_eng.awt_linux-x86/build-tools/android-5.0.50.50.50.50$ ls -l

-rwxrwxr-x 1 awt awt 1118633 Feb  4 19:42 aapt
-rwxrwxr-x 1 awt awt 1261036 Feb  4 19:42 libc++.so

$ file aapt
aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped
$ file libc++.so 
libc++.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

I've built and used older Android versions of build-tools, the last one was 4.3. 我已经构建并使用了较旧的Android版本的构建工具,最后一个是4.3。 To get that one to run, I needed: 为了让它运行,我需要:

$ sudo apt-get install ia32-libs

That allowed me to run it and it worked. 这让我可以运行它并且有效。 With the latest from Android, this is no longer enough. 使用最新的Android,这已经不够了。 I still get the libc++.so: cannot open shared object file message . 我仍然得到libc++.so: cannot open shared object file message

There are other intermediate versions of aapt in the out directory. out目录中还有其他中间版本的aapt。 For example, this one: 例如,这一个:

$ file /aosp/out/host/linux-x86/bin/aapt aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped $ ls -l /aosp/out/host/linux-x86/bin/aapt -rwxrwxr-x 1 awt awt 6978260 Feb 4 17:50 aapt $ file / aosp / out / host / linux-x86 / bin / aapt aapt:ELF 32位LSB共享对象,Intel 80386,版本1(SYSV),动态链接(使用共享库),用于GNU / Linux 2.6.24 ,没有剥离$ ls -l / aosp / out / host / linux-x86 / bin / aapt -rwxrwxr-x 1 awt awt 6978260 2月4日17:50 aapt

This one runs. 这一个运行。 It hasn't been stripped yet so the shared libs are still embedded in it. 它尚未被剥离,因此共享库仍然嵌入其中。 If I strip it: 如果我剥掉它:

$ strip -s aapt
$ ./aapt
./aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

Then we're back to where we started. 然后我们回到我们开始的地方。 What can I do to to make the stripped version run the way it used to? 我该怎么做才能使剥离版本按照以前的方式运行?

This is an older question but a recent upvote on it reminded me that I do have a solution. 这是一个较老的问题,但最近的一个问题提醒我,我确实有一个解决方案。

The answer is to append the location of libc++.so to the current LD_LIBRARY_PATH: 答案是将libc ++的位置附加到当前的LD_LIBRARY_PATH:

$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/libc++.so
$ ./aapt -version
Android Asset Packaging Tool

Usage:
   aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 zipalign:加载共享库时出错:libc ++。所以:无法打开共享对象文件:没有这样的文件或目录 - zipalign: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory 在Ubuntu 12.04 64位上运行Android aapt - Run Android aapt on Ubuntu 12.04 64 bit opensuse 12.1 64 位 - Android - 加载共享库时出错:libz.so.1 - opensuse 12.1 64bit - Android - error while loading shared libraries: libz.so.1 clang:加载共享库时出错:libtinfo.so.5:无法打开共享对象文件:没有这样的文件或目录 - clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory adb:加载共享库时出错:libncurses.so.5:无法打开共享对象文件:没有这样的文件或目录 - adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory 加载共享库时出错:libpulse.so.0:无法打开共享 object 文件:没有这样的文件或目录 - error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory VirtualBox Ubuntu 12.04(64位)访客无法识别Android设备 - VirtualBox Ubuntu 12.04 (64-bit) Guest Not Recognizing Android Device Debian 8.3 Jessie 64位上的AAPT错误 - AAPT error on Debian 8.3 Jessie 64-bit 是AOSP的libc ++。所以和NDK的libc ++ _ shared.so一样吗? - Is AOSP's libc++.so the same as NDK's libc++_shared.so? watchman:加载共享库时出错:libpcre.so.1 - watchman: error while loading shared libraries: libpcre.so.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM