谷歌地图api gradle依赖关系无法解决

Had*_*Abu 3 android google-maps google-play-services android-studio

它向我显示了解决依赖性失败的错误:

Error:(25, 13) Failed to resolve: com.google.android.gms:play-services-maps:11.4.0
Run Code Online (Sandbox Code Playgroud)

这些是我正在使用的依赖项:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-maps:11.4.0'

}
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

Gab*_*tti 11

要使用11.4.0,您必须将maven {url" https://maven.google.com "}添加到您的build.gradle文件中

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)