错误:(22,13)无法解决:com.google.android.gms:play-services:11.2.0

时间:2017-09-05 17:17:44

标签: android-studio

刚开始学习Android Studio。我在Android Studio 2.3.3上。

尝试使用mapActivity,每当项目同步时,我都会收到此错误。

Error:(22, 13) Failed To Resolve: com.google.android.gms:play-services:11.2.0

当我点击"安装资源库并同步项目"时,它什么也没做。

不确定如何让它发挥作用。

它是我的build.gradle依赖项:

dependencies {
    compile 'com.google.android.gms:play-services:11.2.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.google.android.gms:play-services-maps:11.0.4'
    testCompile 'junit:junit:4.12'
}

顶级构建文件是:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

1 个答案:

答案 0 :(得分:1)

我有一个类似的问题,我在编译库版本的末尾有一个+。我删除了+并简单地使用了     编译com.google.android.gms:play-services:11.0.4' 为我修好了,我想知道你是否可以尝试不同的版本,看看是否有效。