Why does Minecraft Forge throw "method <init>()V not found" while building Gradle?

huangapple 未分类评论50阅读模式
英文:

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.zipforge-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 = &#39;https://download.mcbbs.net/maven&#39; }
maven { url = &#39;http://gradle.otakusaikou.com/releases&#39; }
maven { url = &#39;http://bmclapi2.bangbang93.com/maven&#39;}
maven { url = &#39;https://maven.aliyun.com/repository/central&#39; }
maven { url = &#39;https://maven.aliyun.com/repository/jcenter&#39; }
maven { url = &#39;https://files.minecraftforge.net/maven&#39; }

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。

  1. 从官方Minecraft Forge网站下载1.16.1 MDK。直接链接

  2. 将文件解压到所需目录。

  3. 在Intellij中导入新项目,选择build.gradle文件。

  4. 按照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.

  1. Download the 1.16.1 MDK from the official Minecraft Forge website. Direct link

  2. Unzip the file to the directory you want it in.

  3. Import a new project into Intellij, selecting the build.gradle file.

  4. Following the directions in the README.txt, use the terminal to run gradlew genIntellijRuns, then once that's done gradlew --refresh-dependencies.

Step 4 might take a while, but it should finish eventually.

huangapple
  • 本文由 发表于 2020年7月25日 17:27:00
  • 转载请务必保留本文链接:https://java.coder-hub.com/63086655.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定