Error:Execution failed for task ':app:processDebugGoogleServices'. > Please fix the version conflict

来源:互联网 发布:java server error 编辑:程序博客网 时间:2024/06/01 07:54

集成谷歌登录以及谷歌地图后,运行项目,报

Error:Execution failed for task ':app:processDebugGoogleServices'.> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

看一下project.build

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.2.3'        classpath 'com.novoda:bintray-release:0.3.4'        classpath 'com.google.gms:google-services:3.0.0'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}

再者是app.build

apply plugin: 'com.android.application'apply plugin: 'com.google.gms.google-services'dependencies {    compile fileTree(include: ['*.jar'], dir: 'libs')     //google map    compile 'com.google.android.gms:play-services-maps:9.8.0'    compile 'com.google.android.gms:play-services-location:9.8.0'    //google login    compile 'com.google.android.gms:play-services-auth:9.8.0'    }

都是根据文档最新的版本,如果将9.8.0改为9.0.0,那么地图的 mMapView.onStop(), mMapView.onStart();方法没有集成,如果将google-services:3.0.0根据修改为文档查询的3.1.1也不行。

最后的解决办法,将

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

改为

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

即可

阅读全文
0 0