aapt: Bump to 15.0.0.23
It seems that after #21562 aapt couldn't properly parse resources.arsc provided with android-35 platform Updated it to 15.0.0.23 Fixes #21666 Didn't checked myself but probably also: Fixes #22712 Fixes #22667
using CXXFLAGS+=" -fPIC -std=gnu++2b" because it used in base/libs/androidfw/Android.bp and fails with strange template errors on previous versions
Ok, will fix and check arm and i686 fails tomorrow
I was planning to replace the files in the aapt directory with https://github.com/termux/android-build-tools project.
@Biswa96 It will be really awesome! But probably will be a burden to catchup with AOSP changes in the future Better then the current process of course
But probably will be a burden to catchup with AOSP changes in the future
I am sending simple patches to upstream, for example https://android-review.googlesource.com/c/platform/frameworks/native/+/3526633 and will try to simplify the maintenance.
Any update??
Btw thanks for your work guys. I really appreciate it.
@MohammedKHC0 Currently you can download artifacts as described in this comment I tested that it works on armv7 and aarch64 now Unzip it on your computer or on device and And install needed deb package using:
apt install PATH_TO_DEB
on your device
the command aapt2 of aarch64 arch artifact gives:
CANNOT LINK EXECUTABLE "aapt2": cannot locate symbol "png_sig_cmp" referenced by "/data/data/com.termux/files/usr/lib/libandroid-fw.so"...
the command
aapt2of aarch64 arch artifact gives:CANNOT LINK EXECUTABLE "aapt2": cannot locate symbol "png_sig_cmp" referenced by "/data/data/com.termux/files/usr/lib/libandroid-fw.so"...
Probably the branch should be rebased against current master.
the command
aapt2of aarch64 arch artifact gives:CANNOT LINK EXECUTABLE "aapt2": cannot locate symbol "png_sig_cmp" referenced by "/data/data/com.termux/files/usr/lib/libandroid-fw.so"...
Is this fixed?
@twaik @birhburh Sorry for the ping but is there is any work begining done? Also please tell me if there is anyway i can help. Aapt is really needed at many IDEs for Android.
@MohammedKHC0 Will try to fix it today
Fixed this linking error, but it segfaults now at startup, will continue tomorrow
@MohammedKHC0
Last commit should fix aapt2 It works for me on waydroid at least no segfault on start and it shows help Will test on real devices and update this comment: works on arm64 device, works on arm32 device I think, rerun of CI needed for new artifacts
If you don't want to wait for new artifacts Clone my repo (or fetch this pr branch for this repo) and run for arm64:
./scripts/run-docker.sh ./build-package.sh aapt -i
aapt, aapt2, aidl deb files will be in the output dir
also don't forget to install dependencies:
apt install fmt libc++ libexpat libpng libzopfli zlib
~~probably only for arm32 build:
also I should link this libraries statically or add them as dependencies but for now you also need:
apt install libprotobuf abseil-cpp~~
works on clean termux install on arm32 just with apt install PATH_TO_AAPT; apt install PATH_TO_AAPT2
I have noticed that this package actually is safe for attempting on-device builds because the block which disables on-device building in aapt is outdated and no longer correct, and I have found that it is possible to produce and test them using this series of commands, however, unfortunately, the aapt2 that results from my on-device building has a bug that is not present in the cross-compiled version. I will explain all details of what I have observed so far for the purpose of documentation.
pkg upgrade
termux-setup-storage
pkg install git wget gradle
pkg remove aapt aapt2 # remove preexising installations - IMPORTANT
git clone -b aapt_15_23 https://github.com/birhburh/termux-packages.git termux-packages-aapt-15-src
git clone https://github.com/termux/termux-packages.git termux-packages-aapt-15-dest
rm -rf termux-packages-aapt-15-dest/packages/aapt
cp -r termux-packages-aapt-15-src/packages/aapt termux-packages-aapt-15-dest/packages/
cd termux-packages-aapt-15-dest
sed -i -e '/if $TERMUX_ON_DEVICE_BUILD/,+3d' packages/aapt/build.sh
export TERMUX_PKG_TMPDIR=$PREFIX/tmp TERMUX_JAVA_HOME=$PREFIX/lib/jvm/java-21-openjdk
scripts/setup-android-sdk.sh
scripts/setup-termux.sh
./build-package.sh -I -f aapt
cd output
apt reinstall ./*.deb
cd ../..
mkdir -p ~/.gradle
echo "android.aapt2FromMavenOverride=$PREFIX/bin/aapt2" > ~/.gradle/gradle.properties
git clone https://github.com/Appliberated/HelloWorldSelfAware.git
. termux-packages-aapt-15-dest/scripts/properties.sh
echo "sdk.dir=$ANDROID_HOME" > HelloWorldSelfAware/local.properties
cd HelloWorldSelfAware
gradle assembleDebug
However, this error happens, indicating that on-device builds of aapt2 are malformed (this doesn't happen with cross-compiled builds of the aapt2 .deb file that are copied from the cross-compiler device to the Termux device and installed)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> AAPT2 bin Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
Unfortunately I do not know how to debug or fix that error but I wanted to post it here so that it is documented.