Gradle错误java.lang.UnsupportedOperationException:使用Fabric MC 1.19.4时为空

icomxhvb  于 2023-06-06  发布在  Java
关注(0)|答案(1)|浏览(255)

我正试图将Minecraft mod Colormatic移植到1.19.4,因为开发人员已经4个月没有做任何更改了。在我使用Gradle 7.3时,编译工作正常,但我已将其更新到Gradle 8.1.1。我在网上看了看,唯一相关的解决方案是清除缓存,但没有奏效。解决方案提到here
下面是运行./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

如上所述,我尝试删除该高速缓存,上面的日志是删除缓存后的第一次运行。我预计会出现不同的错误,因为源代码还不支持Minecraft 1.19.4,沿着其他更改的依赖项。
我不熟悉Gradle或Java,主要是在玩,所以如果错误是由源代码引起的,还有一个GitHub repo here

drkbr07n

drkbr07n1#

我认为fabric-loom命名方案在0.10-SNAPSHOT之后发生了变化。尝试将build.gradle中的loom版本从0.12-SNAPSHOT更改为1.2-SNAPSHOT

相关问题