Kotlin for Forge

Kotlin for Forge

54M Downloads

Forge reports exported package conflicts for kotlin reflect

Deftu opened this issue ยท 7 comments

commented

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
commented

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

commented

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

commented

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

commented

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

I tried, the issue persists still.

commented

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

commented

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.

commented

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.