gpt4 book ai didi

java - 我该如何解决这个错误? (错误: Gradle DSL method not found: 'implementation()' )

转载 作者:行者123 更新时间:2023-11-30 05:30:05 25 4
gpt4 key购买 nike

当我运行此项目时,未找到 Gradle DSL 方法:发生了“implementation()”错误。我点击了给定的链接,但它不起作用!我无法解决这个问题。你能帮我吗?

这里是构建.gradle

 buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'

implementation 'com.android.support:design:28.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}


task clean(type: Delete) {
delete rootProject.buildDir
}

enter image description here

当我单击链接按钮时,出现错误消息

enter image description here

最佳答案

您正在将依赖项添加到不正确的 gradle 文件中。

所有项目依赖项(此处实现“com.android.support:design:28.0.0”)都应放入您应用的build.gradle 文件中。

仔细看看你的项目结构,那里肯定有2个build.gradle文件,将此依赖项添加到另一个gradle文件中。

关于java - 我该如何解决这个错误? (错误: Gradle DSL method not found: 'implementation()' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57753727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com