Found com.google.android.gms:play-services-places:9.2.1, but version 9.0.2 is needed for the google-services plugin

走远了吗. 提交于 2019-12-12 18:12:50

问题


The title is the error I'm getting trying to compile my Android app. This looks like a recurring problem, but none of the answers for the questions of the same kind helped me.

I've got this in my project's build.gradle

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

And this in my app's 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'

When I try replacing com.google.android.gms:play-services-places:9.2.1 with com.google.android.gms:play-services-places:9.0.2, then I get this compile error:

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

Any idea?


回答1:


OK, the problem was coming from this:

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'

I changed it to this:

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'

And now it works in unison with

compile 'com.google.android.gms:play-services-places:9.2.1'


来源:https://stackoverflow.com/questions/38653992/found-com-google-android-gmsplay-services-places9-2-1-but-version-9-0-2-is-ne

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!