Skip to content

Gradle sync fails after a version change

Checked against Gradle’s documentation, Fabric’s porting page and NeoForge’s MDK on 2 November 2026.

You changed minecraft_version (or the loader version) and now the Gradle sync or the build fails. Work down this list.

A Minecraft version comes with its own loader, Gradle plugin and API builds. Fabric’s porting page bumps Minecraft, Fabric Loader, Loom and Fabric API together (Fabric: Porting to 26.1); NeoForge’s bumps the plugin, Gradle, Java and the NeoForge version (NeoForge, 24 March 2026). Current versions: fabricmc.net/develop for Fabric. The values in Linen’s templates are on the Set up by loader pages.

Every mod you depend on needs a build for the new version. On 26.1, Fabric says no mod for 1.21.11 or older works, not even as compileOnly. See Old mods on 26.1.

4. On Fabric 26.1, change the build script

Section titled “4. On Fabric 26.1, change the build script”

The plugin id, the mod* dependency configurations, remapJar and the mappings line all change. See Port a mod to 26.1.

Refresh the project in your editor first. If it still fails:

Terminal window
./gradlew --refresh-dependencies

This tells Gradle to ignore its cached entries and resolve every dependency again (Gradle: refreshing dependencies). Fabric’s porting page and NeoForge’s MDK README both give this command. The MDK README also suggests ./gradlew clean to reset everything, and says it doesn’t affect your code (NeoForge MDK).

Gradle keeps a background process between builds. If builds behave oddly, stop it and try again (Gradle: stopping the daemon):

Terminal window
./gradlew --stop

This stops every daemon of the same Gradle version. On Windows, use gradlew.bat or .\gradlew in place of ./gradlew.

  • New mod can make a fresh project for the new version, so you can compare its build files with yours.
  • Linen installs the Java version the project needs.
  • Linen Check reads the build with the rest of the mod, and names the file and the fix.