Apktool: New AAPT2 builds

Created on 27 Jun 2020  路  7Comments  路  Source: iBotPeaches/Apktool

hi Connor,
@iBotPeaches

the AAPT2 binaries in Apktool 2.4.1 are no longer usable with Android Gradle plugins 3.6, and 4.0. the newer plugins send some new command line options and AAPT2 dies when it doesn't recognize them.

the binaries are needed when rebuilding apktool-decoded APKs using the normal android build system (this is done by dexpatcher).

would it be too much to ask for updated binaries? this issue has me tied down to old plugin v3.5 and hinders progress.

thank you very much for your help.

Most helpful comment

I'll have to loop back with this later. Mac not building anymore.

bash-3.2$ lunch sdk-eng
In file included from build/make/core/config.mk:305:
In file included from build/make/core/envsetup.mk:285:
build/make/target/product/telephony_system_ext.mk:21: error: _nic.PRODUCTS.[[build/make/target/product/sdk.mk]]: "development/build/product_sdk.mk" does not exist.
06:47:51 dumpvars failed with: exit status 1
bash-3.2$ make LOCAL_MULTILIB=64 USE_NINJA=false aapt
============================================
[100% 147/147] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: prebuilts/clang/host/darwin-x86/Android.bp:23:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:27:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:31:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:35:1: unrecognized module type "llvm_darwin_filegroup"
06:49:54 soong bootstrap failed with: exit status 1

#### failed to build some targets (26 seconds) ####

bash-3.2$ 

I'll take a look when free again.

All 7 comments

I put up unix/win here if that helps for now - https://github.com/iBotPeaches/Apktool/pull/2370

Seems latest has changed how it handles literal numbers, stripping leading 0s. I'll need to investigate if new behavior and tests need to be adapted or if I need to patch to avoid BC breaks.

wow so quick, thank you very much!!

a heads up: i've looked into the android gradle v4 build plugin. it has a pure-JVM incremental resource compiler that replaces AAPT2 in that role for the builds. it's enabled with android.enableJvmResourceCompiler=true in gradle.properties but the implementation is not yet finished. i haven't seen any mentions of this anywhere. it looks like google will soon phase out AAPT2 too.

btw, did you run into trouble with the macos build or is it just WIP?

btw, did you run into trouble with the macos build or is it just WIP?

New mac, hadn't cloned source yet. It'll be delayed a day.

I'll have to loop back with this later. Mac not building anymore.

bash-3.2$ lunch sdk-eng
In file included from build/make/core/config.mk:305:
In file included from build/make/core/envsetup.mk:285:
build/make/target/product/telephony_system_ext.mk:21: error: _nic.PRODUCTS.[[build/make/target/product/sdk.mk]]: "development/build/product_sdk.mk" does not exist.
06:47:51 dumpvars failed with: exit status 1
bash-3.2$ make LOCAL_MULTILIB=64 USE_NINJA=false aapt
============================================
[100% 147/147] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: prebuilts/clang/host/darwin-x86/Android.bp:23:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:27:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:31:1: unrecognized module type "llvm_darwin_filegroup"
error: prebuilts/clang/host/darwin-x86/Android.bp:35:1: unrecognized module type "llvm_darwin_filegroup"
06:49:54 soong bootstrap failed with: exit status 1

#### failed to build some targets (26 seconds) ####

bash-3.2$ 

I'll take a look when free again.

thanks. i'll update this issue with test results using your linux build ASAP.

thanks again!

I updated binaries for all 3 today. Marking as done as new binaries on master.

thank you!!!!! i had a problem with the gradle team. was pissed off and sort of abandoned the project for a year or so. now, with your builds, it's probably a good time to restart it. thanks again!!

Was this page helpful?
0 / 5 - 0 ratings