Summary
The v1.1.0 (and recipe) aapt2 builds shipped from this repo fail on modern Play-Store-style APKs during link/compile when resources use patterns that stock AOSP aapt2 rejects but Apktool’s patched tree accepts. A concrete fix exists upstream as iBotPeaches/Apktool#3130 — unrestrict value format for <item> tags (ResourceParser.cpp).
Without that patch, builds can fail with errors like:
error: invalid value for type 'layout'. Expected a reference.
Instagram (and similar large apps) often trigger this because they use <item type="layout" format="…"> (non-reference) layouts that the stricter code path rejects.
What we tried
- Building/running against ReVanced/aapt2 releases and the pinned submodule + patch stack without a PR #3130–equivalent patch applied after
apktool_ibotpeaches.patch.
Related upstream change
- PR #3130 on iBotPeaches/Apktool (author: Igor Eisberg), re-rooted for AOSP
tools/aapt2 paths.
apktool_ibotpeaches.patch in this repo (and the v1.1.0 release line) does not include that hunk yet, so “latest ReVanced aapt2” alone is not enough for some current APKs.
Community reference implementation
We maintain anirudhmalik/apktool-android — an Android AAR with statically linked libaapt2.so per ABI that runs Apktool in-process. The self-build flow vendors this repo’s CMake recipe under aapt2-build/recipe/ and layers 0002-aapt2-unrestrict-item-tag-value-format.patch (PR #3130) on top of the existing ReVanced patch set.
Docs / patch for review
Suggestion for ReVanced/aapt2
- Absorb PR #3130 (or equivalent) into
patches/ and apply it after apktool_ibotpeaches.patch in patch.sh, or
- Wait / track until iBotPeaches’s
apktool_ibotpeaches.patch export already contains that logic, then drop any duplicate.
Either path would align ReVanced/aapt2 prebuilts with what Apktool 3.x users need for current store APKs.
Optional repro
- App: Instagram (exact version can be added when reproducing).
- Stage:
aapt2 link (not necessarily decode-only).
I’m happy to help validate a PR with a minimal failing resources.xml snippet if maintainers prefer not to attach a full APK.
Summary
The v1.1.0 (and recipe) aapt2 builds shipped from this repo fail on modern Play-Store-style APKs during link/compile when resources use patterns that stock AOSP
aapt2rejects but Apktool’s patched tree accepts. A concrete fix exists upstream as iBotPeaches/Apktool#3130 — unrestrict value format for<item>tags (ResourceParser.cpp).Without that patch, builds can fail with errors like:
Instagram (and similar large apps) often trigger this because they use
<item type="layout" format="…">(non-reference) layouts that the stricter code path rejects.What we tried
apktool_ibotpeaches.patch.Related upstream change
tools/aapt2paths.apktool_ibotpeaches.patchin this repo (and the v1.1.0 release line) does not include that hunk yet, so “latest ReVanced aapt2” alone is not enough for some current APKs.Community reference implementation
We maintain anirudhmalik/apktool-android — an Android AAR with statically linked
libaapt2.soper ABI that runs Apktool in-process. The self-build flow vendors this repo’s CMake recipe underaapt2-build/recipe/and layers0002-aapt2-unrestrict-item-tag-value-format.patch(PR #3130) on top of the existing ReVanced patch set.Docs / patch for review
aapt2-build/README.md0002-aapt2-unrestrict-item-tag-value-format.patchSuggestion for ReVanced/aapt2
patches/and apply it afterapktool_ibotpeaches.patchinpatch.sh, orapktool_ibotpeaches.patchexport already contains that logic, then drop any duplicate.Either path would align ReVanced/aapt2 prebuilts with what Apktool 3.x users need for current store APKs.
Optional repro
aapt2link (not necessarily decode-only).I’m happy to help validate a PR with a minimal failing
resources.xmlsnippet if maintainers prefer not to attach a full APK.