#1068722 aapt: symbol lookup error: libandroidfw.so.0: undefined symbol: _Z18ExtractEntryToFileP10ZipArchiveP8ZipEntryi

Package:
aapt
Source:
aapt
Description:
Android Asset Packaging Tool
Submitter:
Hans-Christoph Steiner
Date:
2025-08-14 15:35:01 UTC
Severity:
normal
#1068722#5
Date:
2024-04-09 18:37:14 UTC
From:
To:
Dear Maintainer,

When adb/fastboot is installed from bookworm-backports, those pull in
android-libziparchive 1:33.0.3-2~bpo12+1, which does not have the symbols that
bookworm's aapt needs to run:

$ aapt
aapt: symbol lookup error: /usr/lib/x86_64-linux-gnu/android/libandroidfw.so.0:
undefined symbol: _Z18ExtractEntryToFileP10ZipArchiveP8ZipEntryi/

I guess the solution would be to also backport android-platform-frameworks-base?

#1068722#10
Date:
2025-08-13 13:22:55 UTC
From:
To:
I get the same error on a RPi 5.
#1068722#15
Date:
2025-08-14 11:26:16 UTC
From:
To:
I *tried* rebuilding aapt2, but that failed.  I am not even sure how the
original packages were even built.  I suspect that there problems with the
depencencies and these packages might need to be rebuilt from scratch.  As it
is now, there are various Android packages in Debian repository that are
broken and bascially unusable.  I think I will have to purge them and download
the original sources and build them that way.

Unless someone has a better idea...

#1068722#20
Date:
2025-08-14 11:56:20 UTC
From:
To:
Here is the log of my attempt to rebuild aapt:

dpkg-buildpackage: info: source package android-platform-frameworks-base
dpkg-buildpackage: info: source version 1:10.0.0+r36-10
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Roger Shimizu <rosh@debian.org>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture arm64
 debian/rules clean
dh clean --with bash-completion
   dh_clean
 dpkg-source -b .
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building android-platform-frameworks-base using existing ./android-platform-frameworks-base_10.0.0+r36.orig.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: warning: ignoring deletion of file media/native/midi/include/Doxyfile.orig, use --include-removal to override
dpkg-source: info: building android-platform-frameworks-base in android-platform-frameworks-base_10.0.0+r36-10.debian.tar.xz
dpkg-source: info: building android-platform-frameworks-base in android-platform-frameworks-base_10.0.0+r36-10.dsc
 debian/rules binary
dh binary --with bash-completion
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
mkdir -p debian/out
dh_auto_configure
make[1]: Leaving directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
   debian/rules override_dh_auto_build-arch
make[1]: Entering directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
dh_auto_build --buildsystem=makefile -- -f debian/libandroidfw.mk
	make -j4 -f debian/libandroidfw.mk
make[2]: Entering directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
mkdir --parents debian/out
clang++ libs/androidfw/ApkAssets.cpp libs/androidfw/Asset.cpp libs/androidfw/AssetDir.cpp libs/androidfw/AssetManager.cpp libs/androidfw/AssetManager2.cpp libs/androidfw/AttributeResolution.cpp libs/androidfw/ChunkIterator.cpp libs/androidfw/ConfigDescription.cpp libs/androidfw/Idmap.cpp libs/androidfw/LoadedArsc.cpp libs/androidfw/Locale.cpp libs/androidfw/LocaleData.cpp libs/androidfw/misc.cpp libs/androidfw/ObbFile.cpp libs/androidfw/PosixUtils.cpp libs/androidfw/ResourceTypes.cpp libs/androidfw/ResourceUtils.cpp libs/androidfw/StreamingZipInflater.cpp libs/androidfw/TypeWrappers.cpp libs/androidfw/Util.cpp libs/androidfw/ZipFileRO.cpp libs/androidfw/ZipUtils.cpp -o debian/out/libandroidfw.so.0 -g -O2 -ffile-prefix-map=/home/heller/android-platform-frameworks-base-10.0.0+r36=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fPIC -DSTATIC_ANDROIDFW_FOR_TOOLS -std=gnu++17 -Wdate-time -D_FORTIFY_SOURCE=2 -DNDEBUG -UDEBU
 G -I/usr/include/android -Wno-c99-designator -Wno-gnu-designator -Wno-gnu-folding-constant -fmessage-length=0 -fno-exceptions -fno-strict-aliasing -no-canonical-prefixes  -Ilibs/androidfw/include -I/usr/include/android  -Wl,-z,relro -Wl,-z,now -fPIC -shared -Wl,-soname,libandroidfw.so.0 -Wl,-rpath=/usr/lib/aarch64-linux-gnu/android -lz -L/usr/lib/aarch64-linux-gnu/android -lziparchive -lutils -llog -lbase
libs/androidfw/ZipUtils.cpp:128:16: error: variable type 'FileReader' is an abstract class
    FileReader reader(fp);
               ^
/usr/include/android/ziparchive/zip_archive.h:337:16: note: unimplemented pure virtual method 'ReadAtOffset' in 'FileReader'
  virtual bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const = 0;
               ^
libs/androidfw/ZipUtils.cpp:136:14: error: variable type 'FdReader' is an abstract class
    FdReader reader(fd);
             ^
/usr/include/android/ziparchive/zip_archive.h:337:16: note: unimplemented pure virtual method 'ReadAtOffset' in 'FdReader'
  virtual bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const = 0;
               ^
libs/androidfw/ZipUtils.cpp:144:18: error: variable type 'BufferReader' is an abstract class
    BufferReader reader(in, compressedLen);
                 ^
/usr/include/android/ziparchive/zip_archive.h:337:16: note: unimplemented pure virtual method 'ReadAtOffset' in 'BufferReader'
  virtual bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const = 0;
               ^
3 errors generated.
make[2]: *** [debian/libandroidfw.mk:39: build] Error 1
make[2]: Leaving directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
dh_auto_build: error: make -j4 -f debian/libandroidfw.mk returned exit code 2
make[1]: *** [debian/rules:38: debian/out/libandroidfw.so] Error 25
make[1]: Leaving directory '/home/heller/android-platform-frameworks-base-10.0.0+r36'
make: *** [debian/rules:44: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2


I looks like tyying to rebuild android-platform-frameworks-base V 10.0.0 using
the android-libziparchive-dev 33.0.3-2 does not work. I am not sure how to
procede. Is there a 33.0.3-2 compatible version of
android-platform-frameworks-base out there somewhere?  Where would I find it?

#1068722#25
Date:
2025-08-14 15:34:00 UTC
From:
To:
OK, a "fixed" set of deb files (built for aarch64 -- for x86_64, you will have
to build it from the included sources) are now uploaded to
https://files.deepsoft.com/Other/android-platform-frameworks-base_10.0.0+r36-10.1/

I have not done any extensive tests beyond testing that aapt2 properly
displays it version info and does not crash with a undefined symbol.

I just made a couple of small changes that allows the code to properly compile
and link against the other Android libraries (33.0.3).