1. 程式人生 > >Error:(23, 0) Gradle DSL method not found: 'google()'

Error:(23, 0) Gradle DSL method not found: 'google()'

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:

然後將gradle中配置改為如下所示,問題解決。

repositories {
    mavenCentral()
    maven {
        url 'https://maven.google.com'
}
} dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0' }