Android SDK - aapt:加载共享库时出错:libc ++。so

时间:2018-01-02 23:35:38

标签: android linux aapt aapt2

我下载了sdk-tools linux-3859397.zip并将其解压缩到/ opt / android(这是我的ANDROID_HOME)

因此,当我启动aapt时,它无法加载libc ++共享库

$ /opt/android/build-tools/27.0.3/aapt
/opt/android/build-tools/27.0.3/aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

但是libc ++存在,例如ldd工具找到了它!

$ ldd /opt/android/build-tools/27.0.3/aapt
    linux-vdso.so.1 (0x00007ffdd66b3000)
    libc++.so => /opt/android/build-tools/27.0.3/lib64/libc++.so (0x00007fc511580000)
    librt.so.1 => /usr/lib64/librt.so.1 (0x00007fc511378000)
    libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fc511170000)
    libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fc510f50000)
    libz.so.1 => /usr/lib64/libz.so.1 (0x00007fc510d38000)
    libm.so.6 => /usr/lib64/libm.so.6 (0x00007fc5109e0000)
    libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc5107c8000)
    libc.so.6 => /usr/lib64/libc.so.6 (0x00007fc5103e0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc511698000)

$ file /opt/android/build-tools/27.0.3/lib64/libc++.so
/opt/android/build-tools/27.0.3/lib64/libc++.so: setgid ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

我尝试安装libstdc ++ - 开发32位和64位,但是没有解决这个问题

感谢您的帮助

注意:与aapt2相同的问题

1 个答案:

答案 0 :(得分:1)

[已解决] 将libc ++。so文件复制到/ lib /之后。问题已解决。

sravan @ host3933:/ lib $ ls -al | grep libc ++

-rwxr-xr-x 1根root 5584312 Aug 20 17:41 libc ++。so

sravan @ host3933:/ lib $ aapt -help

错误:未知命令'-help'

Android资产打包工具

用法:  aapt l [ist] [-v] [-a]文件。{zip,jar,apk}    列出与Zip兼容的存档的内容。