2017-03-15 40 views
0

我所用的輔助加火力雲訊息到我的項目,我遇到了以下錯誤消息,而Android工作室建設項目:版本衝突,同時增加com.google.gms.google服務

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.8.0.

下面是生成文件:

頂級:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

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

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
     classpath 'com.google.gms:google-services:3.0.0' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

應用級:

apply plugin: 'com.android.application' 

android { 
     compileSdkVersion 25 
     buildToolsVersion "25.0.0" 
     defaultConfig { 
     applicationId "in.ac.iitb.treeplantationapp" 
     minSdkVersion 21 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    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:25.0.1' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.android.support:design:25.0.1' 
    compile 'com.google.android.gms:play-services-appindexing:9.8.0' 
    compile 'com.google.android.gms:play-services:10.0.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.google.firebase:firebase-messaging:10.0.1' 
    testCompile 'junit:junit:4.12' 
} 


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

更新您的谷歌資料庫 –

回答

0

您正在使用不同版本的谷歌播放服務的

compile 'com.google.android.gms:play-services-appindexing:9.8.0' 
compile 'com.google.android.gms:play-services:10.0.0' 
compile 'com.google.firebase:firebase-messaging:10.0.1'  

用途:SDK工具

compile 'com.google.android.gms:play-services-appindexing:10.0.1' 
compile 'com.google.android.gms:play-services:10.0.1' 
compile 'com.google.firebase:firebase-messaging:10.0.1'