janic0
janic0

Reputation: 55

Android APK fails because it "requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary"

When I try to install my APK, i get the error:

Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]

My steps to build the APK:

  1. Build the APK using Apktool: apktool build app --use-aapt2 --output app.apk
  2. Zipalign the new APK: zipalign -p -v 4 app.apk apk-aligned.apk
  3. Sign the new APK: apksigner sign --ks-key-alias keys --ks keys --ks-pass xxxxx apk-aligned.apk

Zipalign's output shows that the resources.arsc is not compressed:

Verifying alignment of apk-aligned.apk (4)...
      44 resources.arsc (OK)

In my apktool.yml, resourcesAreCompressed: false.

It seems that what the error message states is not the case. Is there something wrong in my process?

Upvotes: 2

Views: 301

Answers (0)

Related Questions