You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gradle升级至8.1.1后移植Fabric MC 1.19.4模组Colormatic遇异常

移植Minecraft模组Colormatic到1.19.4时Gradle 8.1.1编译报错java.lang.UnsupportedOperationException

我正在将Minecraft模组Colormatic移植到1.19.4版本,原开发者已4个月未更新该模组。此前使用Gradle 7.3可正常完成编译,但升级至Gradle 8.1.1后出现java.lang.UnsupportedOperationException: null错误。我已尝试清除Gradle缓存,问题仍未解决,曾参考FabricMC社区相关讨论尝试修复。

执行./gradlew build --info的完整日志如下:

Initialized native services in: /Users/omay/.gradle/native
Initialized jansi services in: /Users/omay/.gradle/native
Received JVM installation metadata from '/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home': {JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home, JAVA_VERSION=17.0.7, JAVA_VENDOR=Eclipse Adoptium, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.7+7, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.7+7, VM_VENDOR=Eclipse Adoptium, OS_ARCH=aarch64}
The client will now receive all logging from the daemon (pid: 65238). The daemon log file: /Users/omay/.gradle/daemon/8.1.1/daemon-65238.out.log
Starting 23rd build in daemon [uptime: 1 hrs 6 mins 24.966 secs, performance: 99%, GC rate: 0.01/s, heap usage: 10% of 1 GiB]
Using 8 worker leases.
Now considering [/Users/omay/IdeaProjects/colormatic, /Users/omay/IdeaProjects/jukebox] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file '/Users/omay/IdeaProjects/colormatic/settings.gradle'.
Projects loaded. Root project using build file '/Users/omay/IdeaProjects/colormatic/build.gradle'.
Included projects: [root project 'colormatic']

> Configure project :
Evaluating root project 'colormatic' using build file '/Users/omay/IdeaProjects/colormatic/build.gradle'.
The configuration detachedConfiguration1 is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration detachedConfiguration1 is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration detachedConfiguration1 is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration detachedConfiguration1 is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
Fabric Loom: 0.12.56
(kotlinx.metadata.jvm.KotlinClassMetadata) with version (0.4.2) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-metadata-jvm/0.4.2/8f80407e1e84727a7e7b9edd1323081c3ab1d8da/kotlinx-metadata-jvm-0.4.2.jar)
(org.objectweb.asm.ClassVisitor) with version (9.3) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/9.3/8e6300ef51c1d801a7ed62d07cd221aca3a90640/asm-9.3.jar)
(org.objectweb.asm.tree.analysis.Analyzer) with version (9.3) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/9.3/4b071f211b37c38e0e9f5998550197c8593f6ad8/asm-analysis-9.3.jar)
(org.objectweb.asm.commons.ClassRemapper) with version (9.3) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/9.3/1f2a432d1212f5c352ae607d7b61dcae20c20af5/asm-commons-9.3.jar)
(org.objectweb.asm.tree.ClassNode) with version (9.3) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/9.3/78d2ecd61318b5a58cd04fb237636c0e86b77d97/asm-tree-9.3.jar)
(org.objectweb.asm.util.ASMifier) with version (9.3) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-util/9.3/9595bc05510d0bd4b610188b77333fe4851a1975/asm-util-9.3.jar)
(com.fasterxml.jackson.databind.ObjectMapper) with version (2.13.2.2) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.13.2.2/ffeb635597d093509f33e1e94274d14be610f933/jackson-databind-2.13.2.2.jar)
(com.google.gson.Gson) with version (null) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.9.0/8a1167e089096758b49f9b34066ef98b2f4b37aa/gson-2.9.0.jar)
(com.google.common.base.Preconditions) with version (null) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/31.1-jre/60458f877d055d0c9114d9e1a2efb737b4bc282c/guava-31.1-jre.jar)
(org.apache.commons.io.FileUtils) with version (2.11.0) was loaded from (/Users/omay/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.11.0/a2503f302b11ebde7ebc3df41daebe0e4eea3689/commons-io-2.11.0.jar)
The configuration :mainSourceElements is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
:extracting yarn-1.19.4+build.2-v2.jar
Not publishing sources jar as it was not found. Use java.withSourcesJar() to fix.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'colormatic'.
> Failed to setup Minecraft, java.lang.UnsupportedOperationException: null

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --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 584ms

清除缓存后的首次运行仍出现该错误,我原本预期会触发源码不兼容1.19.4版本或依赖变更相关的错误,但实际并非如此。我对Gradle和Java并不熟悉,仅出于兴趣尝试移植该模组,我的GitHub仓库包含当前移植的源码。

内容的提问来源于stack exchange,提问作者Omay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 04:32:01