KotlinForForge icon indicating copy to clipboard operation
KotlinForForge copied to clipboard

Unable to load KotlinForForge correctly on Architectury 1.21

Open Bread-NiceCat opened this issue 1 year ago • 1 comments

Minecraft: 1.21 NeoForge: 21.0.143 Architect Plugin: 3.4.159 Architectury Loom: 1.7.412

modImplementation("thedarkcolour:kotlinforforge-neoforge:5.5.0")
Exception in thread "main" java.lang.module.ResolutionException: Module thedarkcolour.kotlinforforge reads more than one module named fml_loader
	at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:900)
	at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:721)
	at java.base/java.lang.module.Resolver.finish(Resolver.java:380)
	at java.base/java.lang.module.Configuration.<init>(Configuration.java:139)
	at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:493)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:87)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:90)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74)
	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 cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210)
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
	at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:220)

> Task :neoforge:dev.architectury.transformer.TransformerRuntime.main() FAILED

https://github.com/thedarkcolour/KotlinForForghttps://github.com/thedarkcolour/KotlinForForge/issues/103e/issues/103

 modImplementation("thedarkcolour:kotlinforforge-neoforge:5.5.0") {
        exclude group: "net.neoforged.fancymodloader", module: "loader"
    }
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:32)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74)
	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 cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210)
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
	at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:220)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.dataService(CommonLaunchHandler.java:132)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeDataUserdevLaunchHandler.runService(NeoForgeDataUserdevLaunchHandler.java:28)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
	... 10 more
Caused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
	at LAYER PLUGIN/[email protected]/thedarkcolour.kotlinforforge.neoforge.KotlinLanguageLoader.loadMod(KotlinLanguageLoader.kt)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:324)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.lambda$buildMods$10(ModLoader.java:311)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.buildMods(ModLoader.java:317)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:131)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.internal.CommonModLoader.begin(CommonModLoader.java:49)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:46)
	at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:101)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 16 more
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:216)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:216)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:216)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 44 more

> Task :neoforge:dev.architectury.transformer.TransformerRuntime.main() FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':neoforge:dev.architectury.transformer.TransformerRuntime.main()'.
> Build cancelled while executing task ':neoforge:dev.architectury.transformer.TransformerRuntime.main()'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2m 14s

Bread-NiceCat avatar Aug 27 '24 05:08 Bread-NiceCat

I'm also experiencing this btw!

milosworks avatar Oct 07 '24 23:10 milosworks

Did you ever figure out a solution to this? I have started getting this error in my dev environment when trying to update my mods to 1.21.4.

chimericdream avatar Jan 17 '25 04:01 chimericdream

Did you ever figure out a solution to this? I have started getting this error in my dev environment when trying to update my mods to 1.21.4.

try

        implementation("kff") {
                exclude(group = "net.neoforged.fancymodloader", module = "loader")
        }

milosworks avatar Jan 17 '25 04:01 milosworks

I get the following error when I add that:

> Supplied String module notation 'kff' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.

chimericdream avatar Jan 17 '25 04:01 chimericdream

You're supposed to replace "kff" with the Kotlin for Forge dependency

thedarkcolour avatar Jan 17 '25 04:01 thedarkcolour

You're supposed to replace "kff" with the Kotlin for Forge dependency

^

milosworks avatar Jan 17 '25 04:01 milosworks

Ah, my bad. If I'm not directly including KFF in my build.gradle but inheriting it via another mod (YACL in my case), do I add the exclude block to the YACL line or explicitly add KFF to the config?

chimericdream avatar Jan 17 '25 04:01 chimericdream

Ah, my bad. If I'm not directly including KFF in my build.gradle but inheriting it via another mod (YACL in my case), do I add the exclude block to the YACL line or explicitly add KFF to the config?

Hmm probably add it on the mod that you are depending yes

milosworks avatar Jan 17 '25 05:01 milosworks

What's weird is that if I add the exclude block to my YACL dependency like so:

modImplementation("dev.isxander:yet-another-config-lib:${rootProject.yacl_version}-neoforge") {
    exclude(group: "net.neoforged.fancymodloader", module: "loader")
}

I get almost the same error as before, except it says fml_loader found multiple copies of fml_loader, instead of KFF finding them:

Exception in thread "main" java.lang.module.ResolutionException: Module fml_loader reads another module named fml_loader

I can't really tell if this is progress or just a shifting goalpost.

Edit: If it's better for me to create a new ticket and/or move the conversation to Discord, I am happy to do so.

chimericdream avatar Jan 17 '25 05:01 chimericdream

Fixed with 5.8.0. I was accidentally including a transitive dependency on FML.

thedarkcolour avatar May 12 '25 22:05 thedarkcolour

1.21 Neoforge on Architectury still seems to be broken. I've word for word copied the 1.20.4 Emi Loot example and i'm running on 5.9.0.

Crash Report: https://mclo.gs/D5SZtun

sleepy-evelyn avatar Sep 08 '25 18:09 sleepy-evelyn