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

Could not initialize class lanchon.dexpatcher.gradle.helpers.Aapt2MavenUtilsHelper #41

Closed ffdsss closed 1 year ago

ffdsss commented 1 year ago

image

Lanchon commented 1 year ago

i need the full build log. use ./gradlew command line to build and capture.

Lanchon commented 1 year ago

at least run with build with --scan and post the link. could not initialize means an exception in the static initializer was thrown. there is a root cause exception that i cant see there.

ffdsss commented 1 year ago

at least run with build with --scan and post the link. could not initialize means an exception in the static initializer was thrown. there is a root cause exception that i cant see there.

This error will be reported when the AGP version is 4.2.0+. I lower the AGP version to 4.0.1 and this error will not be reported. But there will be the problem of Android resource linking failed

image

This is an error from AGP 4.0.1

log.txt

Lanchon commented 1 year ago

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

from https://github.com/DexPatcher/dexpatcher-gradle/releases:


i dont know the versions of the software you are using because you dont publish your project.

i need to know versions of:

note that release notes for each dxp-gradle version gives you compatible version ranges for AGP and gradle. also the samples for each dxp-gradle linked from their release notes show examples of configurations that work.

Lanchon commented 1 year ago

also note that the latest released dxp-gradle is: https://github.com/DexPatcher/dexpatcher-gradle/releases/tag/v2.0.0

newers are pre-releases as shown in release notes.

also check latest published version here: https://plugins.gradle.org/search?term=dexpatcher

as stated in v2.0.0 release notes you should be using:

you are using AGP 4, so nothing will work. you have to read the docs!

ffdsss commented 1 year ago

also note that the latest released dxp-gradle is: https://github.com/DexPatcher/dexpatcher-gradle/releases/tag/v2.0.0

newers are pre-releases as shown in release notes.

also check latest published version here: https://plugins.gradle.org/search?term=dexpatcher

as stated in v2.0.0 release notes you should be using:

  • Android Gradle plugin v3.4.2. Note: Android Gradle plugin imposes Gradle version limitations.
  • Gradle v5.1.1 (though v5.1.1 through v5.6.4 should work).

you are using AGP 4, so nothing will work. you have to read the docs!

Thank you very much, I changed the version as you asked. After rebuilding, it prompts "AAPT: error: duplicate value for resource 'attr/navigationMode' with config"

image

image

image

image

Lanchon commented 1 year ago

i recommend you use dxp-tool v1.8.0-beta1.

why are you using apktool 2.4? 2.7.0 is the current version.

i can't help you because you are not publishing the complete project. but it seems your project wants to add a value for 'attr/navigationMode'? or maybe apktool is too old? i don't know, i dont have the project.

ffdsss commented 1 year ago

i recommend you use dxp-tool v1.8.0-beta1.

why are you using apktool 2.4? 2.7.0 is the current version.

i can't help you because you are not publishing the complete project. but it seems your project wants to add a value for 'attr/navigationMode'? or maybe apktool is too old? i don't know, i dont have the project.

The version used in your sample project is apktool 2.4, so I also used this one. I have uploaded my local code, and this is the link: https://github.com/ffdsss/patcher-test

ffdsss commented 1 year ago

It has been solved, thank you

Lanchon commented 1 year ago

ok, sorry i didn't have time to look at it yet, but im glad you could solve it by yourself :+1: :+1: