DexPatcher / dexpatcher-gradle

Modify Android applications at source-level in Android Studio
https://dexpatcher.github.io/
GNU General Public License v3.0
83 stars 17 forks source link

[BUG] AAPT2 fails with --no-proguard-location-reference #33

Open Unbrick opened 3 years ago

Unbrick commented 3 years ago

Hey there!

I'm currently trying to patch a application which has ressource issues. I therefore used your sample-project for broken ressources but i'm running in the following error while rebuilding ressources with aapt2 (the one bundeled with apktool 2.4.1):

AAPT: unknown option '--no-proguard-location-reference'.

aapt2 link [options] -o arg --manifest arg files...

... [aapt2 help is shown]

I'm currently running on

I read though quite a lot of release notes and issues on your repositories but could not find a working solution. Trying to add android.enableJvmResourceCompiler=true to the gradle.properties resulted in a java.lang.IllegalStateException: TODO

Thank you in advance!

Edit: Tried out switching versions of apktool (from 2.3.4 - 2.4.2), aapt2 and so on. No success there. Also tried to switch to the applib-sample, there dex2jar throws a error as it is not capable of converting the dex file.

Unbrick commented 3 years ago

Update: I got it to work using the patched-dex sample. As dex2jar was throwing an error, i disabled it using the key

dexpatcherConfig.dex2jar {
    handleExceptions = true
}

which translates to the command line switch --not-handle-exception. Seems like this variable has the wrong initial value.