[英]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.