java.lang.NoClassDefFoundError: com/llamalad7/mixinextras/MixinExtrasBootstrap when using a Lib that jarJars MixinExtra
Charismara opened this issue · 4 comments
Charismara commented
I got a dependency that uses MixinExtras and when i try to start runClient
i'll get this Log:
[19:56:46] [main/DEBUG] [mixin/]: Selecting config mixinextras.init.mixins.json
Exception in thread "main" java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/llamalad7/mixinextras/MixinExtrasBootstrap
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:32)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.run(Launcher.java:108)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.main(Launcher.java:78)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141)
Caused by: java.lang.NoClassDefFoundError: com/llamalad7/mixinextras/MixinExtrasBootstrap
at TRANSFORMER/mixinextras@0.2.0-beta.10/com.llamalad7.mixinextras.platform.forge.MixinExtrasConfigPlugin.onLoad(MixinExtrasConfigPlugin.java:14)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.PluginHandle.onLoad(PluginHandle.java:119)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinConfig.onSelect(MixinConfig.java:707)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.selectConfigs(MixinProcessor.java:498)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:460)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131)
at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:637)
at java.base/java.lang.Class.forName(Class.java:545)
at MC-BOOTSTRAP/fmlloader@1.19.2-43.2.21/net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:25)
at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
... 7 more
Caused by: java.lang.ClassNotFoundException: com.llamalad7.mixinextras.MixinExtrasBootstrap
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:137)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:137)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 29 more
i'm on 1.19.2 Forge
LlamaLad7 commented
Can you push what you have to a branch so I can investigate
Charismara commented
My build script:
buildscript {
repositories {
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath 'org.spongepowered:mixingradle:0.7.+'
}
}
plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
id 'maven-publish'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
apply plugin: 'org.spongepowered.mixin'
ext {
if (!project.hasProperty('manasmodsUsername')) {
System.out.println("No ManasMods Repo User found.")
// DO NOT WRITE ANYTHING INTO THIS FIELD! ANYONE CAN SEE THIS FIELD!!
manasmodsUsername = ""
}
if (!project.hasProperty('manasmodsPassword')) {
System.out.println("No ManasMods Repo User password found.")
// DO NOT WRITE ANYTHING INTO THIS FIELD! ANYONE CAN SEE THIS FIELD!!
manasmodsPassword = ""
}
}
version = "${minecraftVersion}-${modVersion}"
group = 'com.github.manasmods' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "${modId}"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'parchment', version: "${parchmentVersion}-${minecraftVersion}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
// property 'forge.logging.mojang.level', 'debug'
property 'mixin.debug.export', 'true'
mods {
tensura {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('runServer')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'mixin.debug.export', 'true'
arg "nogui"
mods {
tensura {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'mixin.env.remapRefMap', 'true'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', "${modId}", '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/'), '--existing-mod', "manascore"
mods {
tensura {
source sourceSets.main
}
}
forceExit false
}
gameTestServer {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', "${modId}"
mods {
tensura {
source sourceSets.main
source sourceSets.test
}
}
forceExit false
}
}
}
jarJar.enable()
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
maven { url "https://dl.cloudsmith.io/public/manasmods/manascore/maven/" }
maven { url 'https://jitpack.io' }
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
//TerraBlender is used to generate our Biomes
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${minecraftVersion}-${terraBlenderVersion}")
//jarJar(group: 'com.github.glitchfiend', name: 'TerraBlender-forge', version: "[${minecraftVersion}-${terraBlenderVersion.substring(0, terraBlenderVersion.indexOf('.') + 1)},${minecraftVersion}-${getNextMajorMinecraftVersion(terraBlenderVersion)})")
// ManasCore and Dependencies
implementation fg.deobf("com.github.manasmods:ManasCore:${minecraftVersion}-${manasCoreVersion}")
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
//JEI
compileOnly fg.deobf("mezz.jei:jei-${minecraftVersion}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraftVersion}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraftVersion}-forge:${jei_version}")
// Geckolib
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-1.19:${geckolibVersion}")
//jarJar(group: 'software.bernie.geckolib', name: 'geckolib-forge-1.19', version: "[${geckolibVersion.substring(0, geckolibVersion.indexOf('.', geckolibVersion.indexOf('.') + 1))},)")
// Worldedit for easier Building
runtimeOnly fg.deobf("curse.maven:worldedit-225608:3922622")
// MmmMmmMmmMmm (Target Dummy) for Attribute and DMG Tests
runtimeOnly fg.deobf("curse.maven:TargetDummy-225738:4410143")
runtimeOnly fg.deobf("curse.maven:TargetDummyLib-499980:4414538")
}
mixin {
add sourceSets.main, "tensura.refmap.json"
config "tensura.mixins.json"
}
reobf {
// jarJar {}
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Specification-Title" : "tensura",
"Specification-Vendor" : "tensurasareus",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "tensurasareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs" : "tensura.mixins.json"
])
}
}
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
name = "manasmods"
credentials {
username System.getenv().getOrDefault("MANAS_REPO_USER", manasmodsUsername)
password System.getenv().getOrDefault("MANAS_REPO_USER_PASSWORD", manasmodsPassword)
}
url "https://manasmods.bytesafe.dev/maven/manasmods"
}
}
}
def replaceResources = tasks.register("replaceResources", Copy) {
it.outputs.upToDateWhen { false }
//Copy it into the build dir
it.from(sourceSets.main.resources) {
def forgeLoaderVersion = forgeVersion.substring(0, forgeVersion.indexOf('.'))
def manasVersionCheck = "[${manasCoreVersion},)"
def terrablenderMajorVersion = terraBlenderVersion.substring(0, terraBlenderVersion.indexOf('.', terraBlenderVersion.indexOf('.') + 1))
def nextMinecraftVersion = getNextMajorMinecraftVersion(minecraftVersion)
def minecraftVersionCheck = "[${minecraftVersion},${nextMinecraftVersion})"
def geckolibMajorVersion = geckolibVersion.substring(0, geckolibVersion.indexOf('.', geckolibVersion.indexOf('.') + 1))
include "META-INF/mods.toml"
expand 'modVersion': "${modVersion}",
'forgeLoaderVersion': "[${forgeLoaderVersion},)",
'minecraftVersionCheck': "${minecraftVersionCheck}",
'manasVersionCheck': "${manasVersionCheck}",
'terrablenderVersionCheck': "[${terrablenderMajorVersion},)",
'geckolibVersionCheck': "[${geckolibMajorVersion},)"
}
it.into "$buildDir/resources/main/"
}
processResources {
duplicatesStrategy(DuplicatesStrategy.FAIL)
exclude('META-INF/mods.toml')
configure { finalizedBy(replaceResources) }
}
classes.configure {
dependsOn(replaceResources)
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
static String getNextMajorMinecraftVersion(String currentVersion) {
def version = currentVersion.substring(0, currentVersion.indexOf('.'))
def majorVersion = currentVersion.substring(currentVersion.indexOf('.') + 1, currentVersion.indexOf('.', currentVersion.indexOf('.') + 1))
def majorInt = Integer.valueOf(majorVersion)
majorInt++
majorVersion = majorInt.toString()
return "${version}.${majorVersion}"
}
Lib with mixin extras: https://github.com/ManasMods/ManasCore/blob/2ed3ab7be8b33d508e4e4711c9cd35bbfa2f59a5/build.gradle
LlamaLad7 commented
Get rid of
dependencies {
jarJar "com.github.LlamaLad7:MixinExtras:[${mixinExtrasVersion},)"
}
The snippet from the new readme is all you need.
LlamaLad7 commented
This fixed the issue for me, feel free to reopen if that's not the case for you.