【发布时间】:2019-11-04 15:29:38
【问题描述】:
我正在尝试使用 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
}
【问题讨论】:
-
你的 gradle 版本是什么?
-
为什么要在模块 gradle 中添加应用程序依赖项,它应该在 app build.gradle 中