ReVanced / revanced-patcher

💉 ReVanced Patcher used to patch Android applications
https://revanced.app
GNU General Public License v3.0
2.52k stars 208 forks source link

bug: Compiling resources fails for one specific app (with default patches and recommended version) #268

Closed lupomikti closed 8 months ago

lupomikti commented 8 months ago

Bug description

The app in question is Twitch. You'll find the information about the recommended version and patches applied in the log below. After starting the patching process and all classes are compiled, the build fails while attempting to compile modified resources. This is happening only for this app out of the ones I am patching, as the others I have patched compiled and installed without issue (Youtube, Tumblr, Twitter, Pixiv).

Steps were simply:

  1. Download Twitch APK of recommended version
  2. Select the APK from storage and start the patch process with default patches
  3. Build fails on step of compiling modified resources

Error logs

- Device Info
ReVanced Manager: 1.18.0
Model: SM-G990U
Android version: 13
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: tv.twitch.android.app v16.9.1 (Suggested: v16.9.1)
Patches version: v4.0.1
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
Copying APK
Reading APK
Decoding app manifest
Loading patches
Merging integrations
Deleting existing resource cache directory
Decoding resources
Executing patches
Applied 6 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/~~cWSndj3xp_P3hqO0QsJKiw==/app.revanced.manager.flutter-F7jJXr7U_gr3MCygqF_0TA==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/aapt_temp_file, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 33, --version-code, 1609016, --version-name, 16.9.1, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL6246853687064641047.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/build/resources.zip]
    at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:246)
    at brut.androlib.AaptInvoker.invokeAapt(AaptInvoker.java:391)
    at app.revanced.patcher.data.ResourceContext.get(ResourceContext.kt:128)
    at app.revanced.patcher.Patcher.get(Patcher.kt:265)
    at app.revanced.manager.flutter.MainActivity.runPatcher$lambda$36(MainActivity.kt:371)
    at app.revanced.manager.flutter.MainActivity.$r8$lambda$wwTqh4bVDMuwAT_qXBREk8gLHGU(Unknown Source:0)
    at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda5.run(Unknown Source:24)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/data/app/~~cWSndj3xp_P3hqO0QsJKiw==/app.revanced.manager.flutter-F7jJXr7U_gr3MCygqF_0TA==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/aapt_temp_file, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 33, --version-code, 1609016, --version-name, 16.9.1, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL6246853687064641047.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-GNQHOU/cache/build/resources.zip]
    at brut.util.OS.exec(OS.java:104)
    at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:242)
    ... 7 more

Solution

No response

Additional context

An issue with this same error was reported in #155 but the "solution" there was to install the recommended patches (with no mention of if that actually fixed the issue). In any case, here you can see no modifications to the patches to be installed were made, and thus that issue does not apply and I believe this qualifies for a new issue. Additionally, I believe this repo to be more appropriate for the report than the patches repo as nothing actually went wrong with the application of the patches in this build process.

This device is also like new, having just been reset, so there's nothing like a previous installation of the app to interfere.

Acknowledgements

LisoUseInAIKyrios commented 8 months ago

This is not the correct repo to report patch problems.

Your issue is a duplicate of: https://github.com/ReVanced/revanced-patches/issues/2647

Patch using CLI and the latest dev release and it should work.

lupomikti commented 8 months ago

Apologies then. As stated near the end of what I wrote, I did not believe this to be relevant to the patches repo due to the error not occurring when applying the patches. It isn't very clear what should count as an issue for the patcher repo versus the patches repo to someone unfamiliar; perhaps something could be added to the issue template to help explain this and mitigate further confusion. Thank you for pointing me in the right direction.