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.
1. Change every version together
Section titled “1. Change every version together”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.
2. Match Java and Gradle
Section titled “2. Match Java and Gradle”- The Java toolchain must match the new Minecraft version: Wrong Java version.
- The Gradle wrapper must support that Java: Gradle is too old for Java 25.
3. Swap your dependencies
Section titled “3. Swap your dependencies”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.
5. Refresh Gradle’s caches
Section titled “5. Refresh Gradle’s caches”Refresh the project in your editor first. If it still fails:
./gradlew --refresh-dependenciesThis 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).
6. Restart the Gradle daemon
Section titled “6. Restart the Gradle daemon”Gradle keeps a background process between builds. If builds behave oddly, stop it and try again (Gradle: stopping the daemon):
./gradlew --stopThis stops every daemon of the same Gradle version. On Windows, use gradlew.bat or .\gradlew in place of
./gradlew.
In Linen
Section titled “In Linen”- 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.