Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge reports exported package conflicts for kotlin reflect #87

Closed
Deftu opened this issue Nov 30, 2023 · 7 comments
Closed

Forge reports exported package conflicts for kotlin reflect #87

Deftu opened this issue Nov 30, 2023 · 7 comments

Comments

@Deftu
Copy link

Deftu commented Nov 30, 2023

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
@thedarkcolour
Copy link
Owner

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

@Deftu
Copy link
Author

Deftu commented Nov 30, 2023

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

I tried, the issue persists still.

@thedarkcolour
Copy link
Owner

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

@Deftu
Copy link
Author

Deftu commented Dec 2, 2023

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.

@thedarkcolour
Copy link
Owner

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.

@Deftu
Copy link
Author

Deftu commented Dec 6, 2023

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

@thedarkcolour thedarkcolour added this to the Kotlin for Forge shades Kotlin libraries instead of JarJar milestone Apr 29, 2024
@thedarkcolour
Copy link
Owner

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

@thedarkcolour thedarkcolour closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants