Gradle Project with path ':SpongeCommon' could not be found in project ':Sponge'

You can easily add your modules (plugins/dependencies) to the classpath of Sponge, if I’m correct in what you’re saying.

I wouldn’t need to FerusGrim since Eclipse will automatically load in all the dependencies if I run with the project set to my plugin’s project (dependencies are either loaded from a libs directory or from their respective Maven repository).

Thank you simon, I don’t really know where things are hidden in the Sponge scripts. I was indeed using an old mapping.

Just out of curiosity, is there a way to automatically keep the Forge version (and MCP mappings) up-to-date with the version Sponge uses?

Maybe retrieve the settings from the sponge project? I didn’t test this so I don’t know if it will work.

// This in your gradle file
minecraft {
    version = project(":Sponge").minecraft.version
    mappings = project(":Sponge").minecraft.mappings
}

It’s not that simple…

Invalid version notation

I got it to work by using the following lines of code

minecraft {
    version = "1.8-" + project(":Sponge").forgeVersion
    mappings = project(":Sponge").minecraft.mappings
}

Strangely enough (probably because of the weirdness of Gradle, I checked minecraft.gradle)

project(":Sponge").minecraft.version == null

This isn’t even working for me, it keeps saying that the forgeVersion property doesn’t exists and that the mappings are null and that makes no sense.

EDIT: Fixed this issue.

mind posting the fix for users with the same issue?

Alright then, I’ll repost all fixes for the errors above (for @The_Doctors_Life)

Project with path ':SpongeCommon' could not be found in project ':Sponge'

This error occurs when it can’t find the SpongeCommon project. If you are using Git, try (fix by simon816)

git submodule update --init --recursive

If it still doesn’t work after that (or if you don’t use Git), put this in settings.gradle (fix by Kiskae)

include ':Sponge'
include ':SpongeCommon'
include ':SpongeCommon:SpongeAPI'

def dir = rootProject.projectDir
dir = (project(':Sponge').projectDir = new File(dir, "Sponge"))
dir = (project(':SpongeCommon').projectDir = new File(dir, "SpongeCommon"))
project(':SpongeCommon:SpongeAPI').projectDir = new File(dir, "SpongeAPI")

Could not find implementation class 'nl.javadude.gradle.plugins.license.LicensePlugin'

This error is caused by Gradle not being able to resolve it properly. Add this to build.gradle (fix by Kiskae)

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
    }
}

For the SpongeAPI compile error, there is no known fix (other than making sure you’re using the right encoding) and a fix is not required, just ignore all errors & warnings in the Sponge projects.


Mixin failed applying mixins.common.core.json:server.MixinServerConfigurationManager

Sponge failing to apply a Mixin at Runtime. Update your MCP mappings (fix by simon816)

minecraft {
    mappings = project(":Sponge").minecraft.mappings
}

Auto-update Minecraft Forge version (fix that auto-updates MCP mappings by Cybermaxke)

minecraft {
    version = "1.8-" + project(":Sponge").forgeVersion
}
2 Likes

Shall we add a new error to this?

java.lang.IllegalAccessError: tried to access field net.minecraft.entity.EntityList.stringToIDMapping from class org.spongepowered.common.registry.SpongeGameRegistry

I don’t get it, the field is public (static, too).

I had a problem similar to than not long ago.
For me, it was because I had setupDecompWorkspace for SpongeCommon but I was running Sponge(Forge mod).
I fixed it by running setupDecompWorkspace in the project that I was launching the game with.
It’s possible you have a similar problem, where it appears as though the AT has worked, but it’s not in the same project as you’re running the game from.

Running that in the root project (where I run Sponge from) did not fix the error.

Now I keep getting ‘InvalidMixinException’ with the reason that a method couldn’t be found, this works fine when I start the application with ‘Sponge’ as the root folder.

@Cybermaxke

Message & Stacktrace please?

@CrazyPyroEagle Here is the full log of the run and here can you check my gradle build file if needed.

@Cybermaxke Are you sure you’re using the same MCP mappings as Sponge?

Currently used mappings are under the name of snapshot_20150301
Try setting your mappings in build.gradle to use that snapshot.

I am already retrieving the mappings version from the sponge project:

mappings = project(':Sponge').minecraft.mappings

and I also tried setting it manually but that didn’t help. And the method (getEntityData) is also a forge method so there is no mapping needed for it.

@Cybermaxke In your case, net.minecraft.entity.Entity.getEntityData is not a valid method signature. I suggest you check if it is inside your forgeSrc. The best I can suggest is to create a copy of that class and modifying it in a functional way (which I wouldn’t recommend doing if someone could name a different fix).

@CrazyPyroEagle
I don’t think that it will fix my issue, I just tried to debug something and I found out something strange:
When I launch the Sponge project in my IDE the jar that is used is just

[01:26:23] [main/INFO] [STDOUT]: [org.spongepowered.mod.SpongeCoremod:injectData:134]: file:/C:/Users/Seppe/Documents/GitHub/Crystal/Sponge/build/dirtyArtifacts/forgeBin-1.8-11.14.3.1446.jar!/net/minecraft/client/main/Main.class

But when doing this in my mod it says:

[01:30:40] [main/INFO]: [org.crystalpowered.mod.CrystalCore:injectData:45]: file:/C:/Users/Seppe/Documents/GitHub/Crystal/Sponge/SpongeCommon/build/dirtyArtifacts/minecraft_merged_bin_SpongeCommon-1.8.jar!/net/minecraft/client/main/Main.class

EDIT: I resolved this issue, you MUST put the SpongeCommon project under the Sponge project, I you are also using a custom access transformer make sure that the both projects are moved under the forgeBin created for your project.

@CrazyPyroEagle
I resolved the last issue but now I am also getting the 'java.lang.IllegalAccessError: tried to access field ’ errors.

@Cybermaxke I fixed that error by copying net.minecraft.entity.EntityList and setting the access modifier of stringToIDMapping to public. Do the same with net.minecraft.world.WorldProvider and terrainType

Can someone please name a better fix for this?
I blame Sponge, we’re using the same Forge version as the Sponge repository HEAD.

@CrazyPyroEagle
I think that I know how to resolve this, only if I could get it working in gradle.