2017-09-05 28 views
1

刚开始学习Android Studio。我在Android Studio 2.3.3上。错误:(22,13)无法解决:com.google.android.gms:play-services:11.2.0

试图在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() 
    } 
} 
+0

检查你的sdk管理器,你可能没有安装它,或者只是将版本更改为11.0.4 –

回答

1

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