gpt4 book ai didi

java - 错误: Gradle DSL method not found: 'compile()'

转载 作者:行者123 更新时间:2023-12-01 22:05:50 25 4
gpt4 key购买 nike

我正在尝试使用 yelp-fusion-android 库。我尝试更新 gradle 但没有成功。

我收到此错误:

ERROR: Gradle DSL method not found: 'compile()'
Possible causes:
The project 'testProject' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file

The build file may be missing a Gradle plugin.
Apply Gradle plugin

这是 build.gradle:

buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
compile 'io.github.ranga543:yelp-fusion-client:0.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

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

最佳答案

顶级文件中删除此行:

//compile 'io.github.ranga543:yelp-fusion-client:0.1.4'

app/build.gradle 文件中,您可以添加相同的依赖项:

dependencies {
...
implementation 'io.github.ranga543:yelp-fusion-client:0.1.5'
...
}

关于java - 错误: Gradle DSL method not found: 'compile()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58688820/

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