android - 找到 com.google.android.gms :play-services-places:9. 2.1,但 google-services 插件需要版本 9.0.2

标签 android google-play-services

标题是我在尝试编译 Android 应用程序时遇到的错误。 这看起来像是一个反复出现的问题,但同类问题的答案都没有帮助我。

我的项目的 build.gradle 中有这个

dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
}

这在我的应用程序的 build.gradle 中

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:support-v4:24.1.1'
    compile 'com.android.support:support-v13:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'
    compile 'net.hockeyapp.android:HockeySDK:4.0.0'
    compile 'com.google.firebase:firebase-core:9.0.2'
    compile 'com.google.firebase:firebase-database:9.0.2'
    compile 'com.google.firebase:firebase-auth:9.0.2'
    compile 'com.android.support:design:24.1.1'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.amazonaws:aws-android-sdk-cognito:2.2.21'
    compile 'com.amazonaws:aws-android-sdk-s3:2.2.21'
    compile 'com.google.android.gms:play-services-places:9.2.1'
}

apply plugin: 'com.google.gms.google-services'

当我尝试将 com.google.android.gms:play-services-places:9.2.1 替换为 com.google.android.gms:play-services-places:9.0.2 时,出现以下编译错误:

Error:(38, 13) Failed to resolve: com.google.android.gms:play-services-places:9.0.2

有什么想法吗?

最佳答案

好吧,问题是这样的:

compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.firebase:firebase-auth:9.0.2'

我把它改成这样:

compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'

现在它与

协同工作
compile 'com.google.android.gms:play-services-places:9.2.1'

关于android - 找到 com.google.android.gms :play-services-places:9. 2.1,但 google-services 插件需要版本 9.0.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38653992/

相关文章:

java - 默认构造函数无法处理隐式 super 构造函数抛出的异常类型 IOException。必须定义显式构造函数

android - onUpdate() intilized 变量在小部件类的 onReceive 中为空

Android Studio > 创建新项目 > Google Play 服务 Activity : What is this?

android - 无法在 Android 项目中实现 Google map

android - Gradle 插件 google-services 不适用于 gradle-experimental :0. 6.0-alpha7

Android - 以编程方式剪切可绘制图像

Android for 循环不循环?火力地堡

android - java.util.ConcurrentModificationException 和 SharedPreference

Android - Google 登录和 Play 服务版本不兼容

java - Mockito:mock-maker-inline Android GcmNetworkManager mock java.lang.VerifyError Google Play Services v11.0.2