understanding-gradle icon indicating copy to clipboard operation
understanding-gradle copied to clipboard

Artifact Transformer. Asm(java 8) cannot parse java module info(java 9+) classes

Open sumeru2 opened this issue 8 months ago • 1 comments

Hello! I need assistance in resolving an issue related to artifact transformation in Gradle. I've encountered an error due to ASM (Java 8) being unable to process classes with Java module information (Java 9+). If you have the opportunity to analyze the code and identify potential issues, I would appreciate your help. Thank you! snippets of code: build.gradle - https://hastebin.com/share/nujemijoyu.javascript buildSrc/src/main/groovy/org/example/JavaModuleTransform.groovy - https://hastebin.com/share/ofiwevahow.java Errors: https://pastebin.com/pbnBXt0C Java 8 Gradle 8.1.1

sumeru2 avatar Dec 07 '23 19:12 sumeru2

Hi @NikitaFeaucher. The error you shared looks like the problem is not (directly) related to artifact transforms. The stack points at ASMModParser:

at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]

That is using a very old version of ASM here (asm-debug-all-5.2). You should try to upgrade that somehow. ideally to asm-9.6implementation("org.ow2.asm:asm:9.6"). Unfortunately from what you shared I cannot see how this all plays together in your project.

Can you maybe share a complete reproducer project that I can try out?

jjohannes avatar Dec 12 '23 19:12 jjohannes