1
votes

I downloaded the sdk-tools linux-3859397.zip and extract it to /opt/android (which is my ANDROID_HOME)

So, when I launch aapt it fail to load the libc++ shared library

$ /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

But the libc++ exists, as example the ldd tools has found it !

$ 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

I tried to install libstdc++-devel both in 32bit and 64 bits but that do not solve this issue

Thanks for your help

Note: same problem with aapt2

1
Perhaps you need to install multilibs or set LD_LIBRARY_PATH. I seem to recall Android tools are 32-bit, so you probably need multilibs (or whatever that 1 GB collection of packages is called).jww

1 Answers

1
votes

[Solved] After copying libc++.so file to /lib/. Issue resolved.

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

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

sravan@host3933:/lib$ aapt -help

ERROR: Unknown command '-help'

Android Asset Packaging Tool

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