-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
aapt: Bump to 15.0.0.23 #23671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
aapt: Bump to 15.0.0.23 #23671
Conversation
TomJo2000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have been a ton of effort.
Thank you a lot for your contribution.
I assume you have already done local/on-device testing,
but for anyone else reading this who may want to test this before it is merged I will leave instructions below.
(This is a pre-written, saved reply.)
If you want to test this PR please download the appropriate DEB package(s)
from the build artifacts of the associated PR's latest CI run.
After downloading the build artifact, make sure to unzip and un-tar it.
Detailed instructions, if needed.
# finding out what architecture you need
# architecture is just below the TERMUX_VERSION
termux-info
# e.g.
# [...]
# TERMUX_MAIN_PACKAGE_FORMAT=debian
# TERMUX_VERSION=0.118.0
# TERMUX__USER_ID=0
# Packages CPU architecture:
# aarch64
# [...]
# =======================
# make sure `unzip` and `tar` are installed using
pkg install unzip tar
# unzip the artifact (if you have a different architecture this might be arm, i686 or x86_64 instead)
unzip debs-aarch64-*.zip
# untar the artifact
tar xf debs-aarch64-*.tar
# You should now have a debs/ directory in your current working directory
# Install the packages from the local source using
pkg install -- ./debs/*.deb
# to clean up, you can remove the debs/ directory, .tar file and .zip file
rm -rfi debs debs-aarch64-*.zip debs-aarch64-*.tar|
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 |
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 on your device |
|
the command |
Probably the branch should be rebased against current master. |
Is this fixed? |
|
@MohammedKHC0 |
|
Fixed this linking error, but it segfaults now at startup, will continue tomorrow |
conforming to android-35
|
@MohammedKHC0 Last commit should fix aapt2 If you don't want to wait for new artifacts aapt, aapt2, aidl deb files will be in the also don't forget to install dependencies:
|
| _TAG_VERSION=13.0.0 | ||
| _TAG_REVISION=6 | ||
| _TAG_VERSION=15.0.0 | ||
| _TAG_REVISION=23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be revision 36 which is the newest of this major version (or version 16.0.0 revision 2 which exists and is the newest overall)?
| _TAG_VERSION=15.0.0 | ||
| _TAG_REVISION=23 | ||
| TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION} | ||
| TERMUX_PKG_REVISION=18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is proper for this line TERMUX_PKG_REVISION to be deleted because TERMUX_PKG_VERSION increased, is that correct? or is this package a special case (there are no other special cases as far as I know so if this package is one, I would also be interested to find out why)
| termux_step_make() { | ||
| . $TERMUX_PKG_BUILDER_DIR/sources.sh | ||
|
|
||
| termux_setup_protobuf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is termux_setup_protobuf needed again here when it was already used during termux_step_pre_configure?
|
|
||
| termux_setup_protobuf | ||
|
|
||
| export PATH=$TERMUX_PKG_HOSTBUILD_DIR/_prefix/bin:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this line no longer necessary because there is no hostbuild-step in this package anymore, so this folder does not exist?
|
|
||
| termux_setup_protobuf | ||
|
|
||
| export PATH=$TERMUX_PKG_HOSTBUILD_DIR/_prefix/bin:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, a few lines above this line, there is a block
# Certain packages are not safe to build on device because their
# build.sh script deletes specific files in $TERMUX_PREFIX.
if $TERMUX_ON_DEVICE_BUILD; then
termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds."
fiThis is outdated and this package is not unsafe for on-device build anymore. This is here because once, long ago, aapt used to use rm -rf $TERMUX_PREFIX/include/aosp during build.sh, but it doesn't anymore and things changed so that folder doesn't exist in any present-day Termux anymore.
| TERMUX_PKG_MAINTAINER="@termux" | ||
| _TAG_VERSION=13.0.0 | ||
| _TAG_REVISION=6 | ||
| _TAG_VERSION=15.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an additional patch you will need in order to successfully build this PR after the update to NDK r28c.
--- a/base/tools/aapt/ResourceTable.h
+++ b/base/tools/aapt/ResourceTable.h
@@ -20,6 +20,8 @@
class XMLNode;
class ResourceTable;
+#include "XMLNode.h"
+
enum {
XML_COMPILE_STRIP_COMMENTS = 1<<0,
XML_COMPILE_ASSIGN_ATTRIBUTE_IDS = 1<<1,|
I have noticed that this package actually is safe for attempting on-device builds because the block which disables on-device building in 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 assembleDebugHowever, this error happens, indicating that on-device builds of Unfortunately I do not know how to debug or fix that error but I wanted to post it here so that it is documented. |
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