KotlinForForge icon indicating copy to clipboard operation
KotlinForForge copied to clipboard

Forge reports exported package conflicts for kotlin reflect

Open Deftu opened this issue 1 year ago • 6 comments
trafficstars

This is my first time writing a mod using KFF and I've ran into an issue where Forge will throw an exception, complaining that my mod exports the same package as KFF: kotlin.reflect.jvm.internal.impl.load.java

I've made sure that I'm not shading any Kotlin stdlib, reflect or coroutine dependencies into my JAR along with okhttp and I can't seem to find where Forge's JiJ locator is finding these files.

[15:49:00] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 3 dependencies adding them to mods collection
Exception caught from launcher
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:66)
	at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88)
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126)
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:71)
Caused by: java.lang.module.ResolutionException: Modules thedarkcolour.kotlinforforge and mantle export package kotlin.reflect.jvm.internal.impl.load.java to module thedarkcolour.kotlinforforge.lib
	at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:901)
	at java.base/java.lang.module.Resolver.failTwoSuppliers(Resolver.java:815)
	at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:736)
	at java.base/java.lang.module.Resolver.finish(Resolver.java:380)
	at java.base/java.lang.module.Configuration.<init>(Configuration.java:140)
	at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:494)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.buildTransformingClassLoader(TransformationServicesHandler.java:60)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:104)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141)
	... 8 more

Deftu avatar Nov 30 '23 14:11 Deftu

If this is in IntelliJ, you'll need to exclude okhttp's transitive dependencies on Kotlin in Gradle.

thedarkcolour avatar Nov 30 '23 16:11 thedarkcolour

If this is in IntelliJ, you'll need to exclude okhttp's transitive dependencies on Kotlin in Gradle.

I tried, the issue persists still.

Deftu avatar Nov 30 '23 19:11 Deftu

Could you send a link to your mod's GitHub repository?

thedarkcolour avatar Dec 01 '23 23:12 thedarkcolour

Could you send a link to your mod's GitHub repository?

It's private. I could provide snippets of the build files if you'd like.

Deftu avatar Dec 02 '23 10:12 Deftu

Have you checked the compiled JAR file for your mod with a ZIP viewer like 7zip? Make sure you aren't shadowing the dependencies and check META-INF/jarjar for Kotlin libraries.

thedarkcolour avatar Dec 06 '23 06:12 thedarkcolour

Have you checked the compiled JAR file for your mod with a ZIP viewer like 7zip? Make sure you aren't shadowing the dependencies and check META-INF/jarjar for Kotlin libraries.

Yeah, I double checked that nothing is being shaded or JiJ'ed in

Deftu avatar Dec 06 '23 10:12 Deftu

Marking as duplicate of #86 since the root cause is the same

thedarkcolour avatar May 04 '24 23:05 thedarkcolour