ReVanced/revanced-manager

bug: App fails to build patched APK

Closed this issue · 5 comments

Bug description

ReVanced manager successfully executes all patches, but then fails to build the patched APK.

Version of ReVanced Manager and version & name of app you are patching

ReVanced Manager version: 1.20.1
App name: Reddit (com.reddit.frontpage)
App version: 2024.19.0

Installation method

Regular

ReVanced Manager logs

all I get is a local content:// link

Patch logs

- Device Info
ReVanced Manager: 1.20.1
Model: SM-N950F
Android version: 9
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: com.reddit.frontpage v2024.19.0 (Suggested: Any)
Patches version: v4.7.0
Patches added: Default
Patches removed: None
Default patch options changed: None

- Settings
Allow changing patch selection: true
Version compatibility check: true
Show universal patches: false
Patches source: revanced/revanced-patches
Integration source: revanced/revanced-integrations

- Logs
Reading APK
Decoding app manifest
Loading patches
Merging integrations
Deleting existing temporary files directory
Decoding resources
Executing patches
Applied 4 patches
Compiling patched dex files
Compiled 12 dex files
Compiling modified resources
An error occurred:
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/app/app.revanced.manager.flutter-jBSVu0nYsayowX8sqYE4mg==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/patched/resources/resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1593346, --version-name, 2024.19.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL8251347334831401238.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/apk/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/apk/build/resources.zip]
	at brut.androlib.AaptInvoker.invokeAapt2(Unknown Source:563)
	at brut.androlib.AaptInvoker.invokeAapt(Unknown Source:104)
	at app.revanced.patcher.data.ResourceContext.get(SourceFile:0)
	at app.revanced.patcher.Patcher.get(SourceFile:0)
	at app.revanced.manager.flutter.MainActivity.runPatcher$lambda$34(Unknown Source:495)
	at app.revanced.manager.flutter.MainActivity.$r8$lambda$hTJfH-rv2j-9Y91G5H_L5jFDN6U(SourceFile:0)
	at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda5.run(SourceFile:0)
	at java.lang.Thread.run(Thread.java:764)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/data/app/app.revanced.manager.flutter-jBSVu0nYsayowX8sqYE4mg==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/patched/resources/resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1593346, --version-name, 2024.19.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL8251347334831401238.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/apk/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-AZVTRN/revanced-temporary-files/apk/build/resources.zip]
	at brut.util.OS.exec(Unknown Source:75)
	at brut.androlib.AaptInvoker.invokeAapt2(Unknown Source:542)
	... 7 more

Acknowledgements

  • This issue is not a duplicate of an existing bug report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
  • The bug is only related to ReVanced Manager

Just reproduced this with ReVanced CLI (4.6.0) as well:

INFO: Loading patches
INFO: Deleting existing temporary files directory
INFO: Decoding app manifest
INFO: Spoof Wi-Fi connection excluded
INFO: Remove screenshot restriction excluded
INFO: Remove screen capture restriction excluded
INFO: Export all activities excluded
INFO: Enable Android debugging excluded
INFO: Override certificate pinning excluded
INFO: Hex excluded
INFO: Change package name excluded
INFO: Spoof SIM country excluded
INFO: Predictive back gesture excluded
INFO: Setting patch options
INFO: Merging integrations
INFO: Deleting existing temporary files directory
INFO: Decoding resources
INFO: Executing patches
INFO: Disable screenshot popup succeeded
INFO: Hide ads succeeded
INFO: Sanitize sharing links succeeded
INFO: Unlock premium Reddit icons succeeded
INFO: Compiling patched dex files
INFO: Compiled classes.dex
INFO: Compiled classes2.dex
INFO: Compiled classes3.dex
INFO: Compiled classes4.dex
INFO: Compiled classes5.dex
INFO: Compiled classes6.dex
INFO: Compiled classes7.dex
INFO: Compiled classes8.dex
INFO: Compiled classes9.dex
INFO: Compiled classes10.dex
INFO: Compiled classes11.dex
INFO: Compiled classes12.dex
INFO: Compiling modified resources
WARNING: C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\res\values\styles.xml:2661: error: expected enum but got (raw string) 0.
WARNING: C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\res\values\styles.xml:3268: error: expected enum but got (raw string) 1.
WARNING: C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\res\values\styles.xml:3271: error: expected enum but got (raw string) 1.
WARNING: C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\res\values\styles.xml:3303: error: expected enum but got (raw string) 1.
WARNING: error: failed linking references.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Leo\AppData\Local\Temp\brut_util_Jar_82628775468244047417882322082636415351.tmp, link, -o, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\patched\resources\resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1593346, --version-name, 2024.19.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, C:\Users\Leo\AppData\Local\Temp\APKTOOL9919622026413025339.tmp, -0, arsc, -I, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\1.apk, --manifest, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\AndroidManifest.xml, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\build\resources.zip]
        at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:249)
        at brut.androlib.AaptInvoker.invokeAapt(AaptInvoker.java:394)
        at app.revanced.patcher.data.ResourceContext.get(ResourceContext.kt:134)
        at app.revanced.patcher.Patcher.get(Patcher.kt:268)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:312)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Leo\AppData\Local\Temp\brut_util_Jar_82628775468244047417882322082636415351.tmp, link, -o, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\patched\resources\resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1593346, --version-name, 2024.19.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, C:\Users\Leo\AppData\Local\Temp\APKTOOL9919622026413025339.tmp, -0, arsc, -I, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\1.apk, --manifest, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\AndroidManifest.xml, C:\Users\Leo\Documents\ReVanced\ProgData\com.reddit.frontpage_2024.19.0-1593346_minAPI26(arm64-v8a,armeabi-v7a,x86_64)(nodpi)_apkmirror.com-patched-temporary-files\patcher\apk\build\resources.zip]
        at brut.util.OS.exec(OS.java:104)
        at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:245)
        ... 13 more

This issue is caused by AAPT and out of our reach to fix

@oSumAtrIX can you elaborate on the "out of reach to fix"? Right now any Reddit version past 2024.17 (so versions .18, .18.1, and so on) cannot be patched with this error. If this is expected, can the "recommended version" returned from the API recommend .17, or a warning be displayed in the log view that this is an expected issue and that users should use .17 for now?

That's already being done in the patches repo

Thanks. I thought the RV project was using a monorepo and didn't catch the patches repo.