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

Android SDK - aapt: error while loading shared libraries: libc++.so

我下载了 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

我尝试在 32 位和 64 位中安装 libstdc++-devel,但这并没有解决这个问题

感谢您的帮助

注:与aapt2同样的问题

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

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

-rwxr-xr-x 1 root root 5584312 8 月 20 日 17:41 libc++.so

sravan@host3933:/lib$ aapt -help

错误:未知命令“-help”

Android 资产打包工具

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