Error:(23, 0) Gradle DSL method not found: 'google()'
阿新 • • 發佈:2019-02-06
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}
在重建工程時報錯,報錯如下:
Error:(23, 0) Gradle DSL method not found: ‘google()’
Possible causes:
- The project ‘CoolWeather’ may be using a version of the Android Gradle plug-in that does not contain the method (e.g. ‘testCompile’ was added in 1.1.0).
- The project ‘CoolWeather’ 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
然後將gradle中配置改為如下所示,問題解決。
repositories {
mavenCentral()
maven {
url 'https://maven.google.com'
}
}
dependencies {
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}