Update to 1.21.x from 1.21
Psychodeus opened this issue ยท 2 comments
I changed depends from "minecraft": "1.21" to "minecraft": "~1.21" and it's not working, please update this slightly. Thanks.
hazel@Hazels-MacBook-Pro animal-feeding-trough % ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-8.6-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%
Welcome to Gradle 8.6!
Here are the highlights of this release:
- Configurable encryption key for configuration cache
- Build init improvements
- Build authoring improvements
For more details see https://docs.gradle.org/8.6/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'animal_feeding_trough'.
Could not resolve all files for configuration ':classpath'.
Could not resolve com.mojang:datafixerupper:6.0.8.
Required by:
project : > dev.architectury.loom:dev.architectury.loom.gradle.plugin:1.6-SNAPSHOT:20240718.120752-1 > dev.architectury:architectury-loom:1.6-SNAPSHOT:20240718.120752-1
> No matching variant of com.mojang:datafixerupper:6.0.8 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.6' but:
- Variant 'apiElements' capability com.mojang:datafixerupper:6.0.8 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'runtimeElements' capability com.mojang:datafixerupper:6.0.8 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Try:
Review the variant matching algorithm at https://docs.gradle.org/8.6/userguide/variant_attributes.html#sec:abm_algorithm.
No matching variant errors are explained in more detail at https://docs.gradle.org/8.6/userguide/variant_model.html#sub:variant-no-match.
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 29s
Can someone tell me why build failed? I tried to gradlew build from 21.1 branch.
Check your Gradle settings to ensure you're targeting AT LEAST JDK 21. I had issues like this when trying to upgrade Gradle and it kept going back to JDK 17. It's not tied to the mod, it's how Gradle was installed and is running.
Any mod you're building for 1.20.5 and later must target at least JDK 21. You can also see in the build.gradle file that it's JDK 21.
The other thing to check is that you're setting the minecraft_version in gradle.properties to 1.21.+
By using the + wildcard it will allow the mod to be loaded in any 1.21.x versions, though functionality isn't guaranteed. It will at least get to the point of loading in. That's also the only setting that really needs to change, so wherever you found that depends setting it can be reverted.