【问题标题】:gradle build.gradle issue with "version:"(forge modding)gradle build.gradle 问题与“版本:”(伪造改装)
【发布时间】:2021-09-18 11:32:57
【问题描述】:

我是 10000000000% 的新手,对 Forge 模组进行编码。 我正在尝试运行此命令:

./gradlew setupdecompworkspace

通过文件路径后,我在终端中输入了这个。 我收到此错误消息:

* What went wrong:
Could not compile build file '/Users/fred/Desktop/Mods-In-Progress/LearningMod/build.gradle'.
> startup failed:
  build file '/Users/fred/Desktop/Mods-In-Progress/LearningMod/build.gradle': 15: unexpected token: 16.5 @ line 15, column 13.
     version =‘1.16.5-1.0.0’
                     ^
  
  1 error


* Try:
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 5s
FC-MBP3-3:LearningMod MYNAME$ 

我的 build.gradle 文件是这样的(顺便说一句,我没有展示全部内容):

buildscript {
    repositories {
        maven { url = 'https://maven.minecraftforge.net' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
    }
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version =‘1.16.5-1.0.0’
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'modid'

所以,我的问题是如何修复错误消息。我已经尝试了我能想到的一切。我正在关注本教程:https://www.youtube.com/watch?v=JFVFqZo5t5Q
谢谢,
创意无人机

另外,我有一台旧的 Mac。操作系统版本 10.8 左右 Owo 很快就会有新的 好的,有人解决了这个问题,但我仍然收到错误代码,错误代码在评论中。

【问题讨论】:

    标签: java eclipse gradle build.gradle minecraft-forge


    【解决方案1】:

    您需要使用'',而不是‘’。将该行替换为version ='1.16.5-1.0.0'

    【讨论】:

    • 版本=“1.16.5-1.0.0”怎么样
    • @CreativeDrone 不,这也是错误的。你需要"",而不是“”"1.16.5-1.0.0" 不过应该没问题。
    • 不!不修复它
    • 那是因为你还是没有做对。复制粘贴我写的,如果还是不行,就贴出新的错误。
    • 第 1 部分:失败:构建失败并出现异常。 * 其中:构建文件 '/Users/fred/Desktop/Mods-In-Progress/LearningMod/build.gradle' * 出了什么问题:无法编译构建文件 '/Users/fred/Desktop/Mods-In-Progress/LearningMod /build.gradle'。 > 启动失败:语义分析期间的一般错误:不支持的类文件主要版本 60 ~这里的一些错误内容太长了~ 1 个错误
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-11
    相关资源
    最近更新 更多