Nov 15, 1:28am

This error means your aapt2 binary is too old to parse the resources.arsc inside the API 35 android.jar: starting with API 35, the framework resources are compiled with a newer table format that older aapt2 versions can't read (bundletool issue #381, Stack Overflow). It's not a corrupted download.

Fix: use a recent aapt2 from build-tools

1. Check what you're running:

bash
aapt2 version

If it's older than 34.x (likely, e.g. the old AOSP aapt2 packaged by Debian), that's the problem.

2. Install a current build-tools in your SDK:

bash
/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;35.0.0"

3. Call aapt2 by its full path from build-tools instead of the system one:

bash
/opt/android-sdk/build-tools/35.0.0/aapt2 link \
    -o overlay.apk \
    -I /opt/android-sdk/platforms/android-35/android.jar \
    --manifest AndroidManifest.xml overlay.flat

If sdkmanager isn't installed either, the quickest route is downloading the latest command-line tools zip from the Android Studio page, unzipping it into /opt/android-sdk/cmdline-tools/latest, and running the install above.

Workarounds

  • If you can't update aapt2, point -I at an older platform jar instead, e.g. platforms/android-34/android.jar (install it with sdkmanager "platforms;android-34"). String resources resolve the same way; you only lose access to API 35 symbols, which an overlay of values/strings.xml doesn't need.
  • Make sure overlay.flat was compiled by the same aapt2 you link with, otherwise you can hit similar table-format mismatches.
Nov 15, 1:28am

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more