首页 > 解决方案 > build.gradle 错误。抱歉不能把错误放在这里看正文

问题描述

我正在关注网站上的教程“ https://medium.com/discord-bots/making-a-basic-discord-bot-with-java-834949008c2b ”我收到错误Receiver class com.github.jengelman.gradle .plugins.shadow.internal.DependencyFileCollection 没有定义或继承接口 org.gradle.api.Buildable 的已解析方法“抽象 org.gradle.api.tasks.TaskDependency getBuildDependencies()”的实现。

这是我的 build.gradle 代码。

plugins {
    id 'java'
    id 'application'
    id 'com.github.johnrengelman.shadow' version'2.0.1'
}
mainClassName = "Main"

group 'BlueBot'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile 'net.dv8tion:JDA:4.0.0_62'
}

如果您无论如何要解决此问题或需要任何其他信息,请告诉我。

感谢您的时间。

标签: javagradlediscord

解决方案


您需要更新影子版本

id 'com.github.johnrengelman.shadow' version'5.2.0'

你可以在GitHub 上找到最新版本


推荐阅读