英文:
Why does Minecraft Forge throw "method <init>()V not found" while building Gradle?
问题
我想为Minecraft-1.16.1制作一个mod。
我从https://cowtransfer.com/s/d42bf22b23bc46下载了gradle-4.10.3-bin.zip,以及从https://files.minecraftforge.net/下载了forge-1.16.1-32.0.63-mdk,IDEA开始自动构建Gradle。
我在build.gradle中添加了以下内容:
maven { url = 'https://download.mcbbs.net/maven' }
maven { url = 'http://gradle.otakusaikou.com/releases' }
maven { url = 'http://bmclapi2.bangbang93.com/maven'}
maven { url = 'https://maven.aliyun.com/repository/central' }
maven { url = 'https://maven.aliyun.com/repository/jcenter' }
maven { url = 'https://files.minecraftforge.net/maven' }
因为访问或下载gradle.org太慢了。
但是IDEA报错:
> 原因:
> org.gradle.api.internal.artifacts.repositories.AbstractArtifactRepository:
> 方法<init>()V未找到。
我已经尝试了多次,但问题还没有解决。
我需要重新下载gradle.zip
和forge-mdk
吗?还是只需要等待?
英文:
I want to make a mod for Minecraft-1.16.1.
I've downloaded gradle-4.10.3-bin.zip from https://cowtransfer.com/s/d42bf22b23bc46 and forge-1.16.1-32.0.63-mdk from https://files.minecraftforge.net/,and IDEA starts building Gradle automatically.
I added
maven { url = 'https://download.mcbbs.net/maven' }
maven { url = 'http://gradle.otakusaikou.com/releases' }
maven { url = 'http://bmclapi2.bangbang93.com/maven'}
maven { url = 'https://maven.aliyun.com/repository/central' }
maven { url = 'https://maven.aliyun.com/repository/jcenter' }
maven { url = 'https://files.minecraftforge.net/maven' }
in build.gradle because gradle.org is too slow to visit or download.
But IDEA throws
> Cause:
> org.gradle.api.internal.artifacts.repositories.AbstractArtifactRepository:
> method <init>()V not found soon.
I've retried for several times but the problem hasn't been resolved.
Do I need to download gradle.zip
and forge-mdk
again? Or do I just need to wait?
答案1
得分: 0
你不需要从其他来源获取Gradle。Forge MDK会处理它。
你应该按照以下步骤重新安装MDK。
-
从官方Minecraft Forge网站下载1.16.1 MDK。直接链接
-
将文件解压到所需目录。
-
在Intellij中导入新项目,选择
build.gradle
文件。 -
按照
README.txt
中的说明,使用终端运行gradlew genIntellijRuns
,完成后运行gradlew --refresh-dependencies
。
第4步可能需要一些时间,但最终会完成。
英文:
You shouldn't need to get Gradle from any other source. The Forge MDK will take care of it.
You should reinstall the MDK, following these steps.
-
Download the 1.16.1 MDK from the official Minecraft Forge website. Direct link
-
Unzip the file to the directory you want it in.
-
Import a new project into Intellij, selecting the
build.gradle
file. -
Following the directions in the
README.txt
, use the terminal to rungradlew genIntellijRuns
, then once that's donegradlew --refresh-dependencies
.
Step 4 might take a while, but it should finish eventually.
专注分享java语言的经验与见解,让所有开发者获益!
评论