Android 请通过更新google服务插件或Updatei的版本来修复版本冲突

Android 请通过更新google服务插件或Updatei的版本来修复版本冲突,android,android-gradle-plugin,Android,Android Gradle Plugin,我试图像教程一样将Firebase添加到我的应用程序中。 我得到了这个错误: 错误:任务“:app:processDebugGoogleServices”的执行失败。 请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为9.4.0来修复版本冲突 我的毕业生。 build.gradle(项目): // Top-level build file where you can add configuratio

我试图像教程一样将Firebase添加到我的应用程序中。 我得到了这个错误:

错误:任务“:app:processDebugGoogleServices”的执行失败。 请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为9.4.0来修复版本冲突

我的毕业生。

build.gradle(项目):

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'

        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.0.0'

    }
}


allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io"}
    }
}
dependencies {

    //compile 'com.google.android.gms:play-services:8.3.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
    compile files('libs/NativeXMonetizationSDK_v5.4.12.jar')
    compile files('libs/Parse-1.3.8.jar')
    compile files('libs/SuperRewards-3.1b.jar')
    compile files('libs/TrialpayAndroidSdk.jar')
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/adcolony.jar')
    compile 'pl.bclogic:pulsator4droid:1.0.3'

    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'

    compile 'com.google.android.gms:play-services-auth:10.0.1'

    compile 'com.mcxiaoke.volley:library:1.0.18'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile files('libs/adscendmedia1.0.1.jar')
    compile files('libs/dagger-1.2.2.jar')
    compile 'com.github.leonardoxh:custom-font:1.2'


    compile 'com.github.leonardoxh:custom-font:1.2'
    compile 'com.github.chrisbanes:PhotoView:1.2.6'


    compile files('libs/javax.inject-1.jar')
    compile files('libs/mediationsdk-6.2.2.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/personasdk1.1.jar')
    compile files('libs/picasso-2.4.0.jar')
    compile files('libs/tapjoyconnectlibrary.jar')
    compile files('libs/vungle-publisher-adaptive-id-3.3.1.jar')
    compile files('libs/chartboost.jar')
    compile files('libs/applovin-sdk-6.1.5.jar')
    compile files('libs/heyzap.jar')
    compile files('libs/revmob.jar')
    compile project(':appGradeLib')
    //compile project(':sensiblefacebooksdk')
    compile project(':googleplayserviceslib')
    compile files('libs/AdxmiCustomizedSdk_v1.2.0_2015-11-13.jar')
    compile files('libs/AdxmiSdk_v5.4.0_2015-11-12.jar')
    compile project(':unity-ads')
    compile files('libs/org.apache.http.legacy.jar')

    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.vstechlab.easyfonts:easyfonts:1.0.0'
    compile 'com.febaisi:custom-textview:0.0.3'
    compile 'com.scopely:fontain:1.0.0'

    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.android.support:appcompat-v7:25.0.0'

}
apply plugin: 'com.google.gms.google-services'
build.gradle(应用程序):

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'

        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.0.0'

    }
}


allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io"}
    }
}
dependencies {

    //compile 'com.google.android.gms:play-services:8.3.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
    compile files('libs/NativeXMonetizationSDK_v5.4.12.jar')
    compile files('libs/Parse-1.3.8.jar')
    compile files('libs/SuperRewards-3.1b.jar')
    compile files('libs/TrialpayAndroidSdk.jar')
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/adcolony.jar')
    compile 'pl.bclogic:pulsator4droid:1.0.3'

    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'

    compile 'com.google.android.gms:play-services-auth:10.0.1'

    compile 'com.mcxiaoke.volley:library:1.0.18'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile files('libs/adscendmedia1.0.1.jar')
    compile files('libs/dagger-1.2.2.jar')
    compile 'com.github.leonardoxh:custom-font:1.2'


    compile 'com.github.leonardoxh:custom-font:1.2'
    compile 'com.github.chrisbanes:PhotoView:1.2.6'


    compile files('libs/javax.inject-1.jar')
    compile files('libs/mediationsdk-6.2.2.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/personasdk1.1.jar')
    compile files('libs/picasso-2.4.0.jar')
    compile files('libs/tapjoyconnectlibrary.jar')
    compile files('libs/vungle-publisher-adaptive-id-3.3.1.jar')
    compile files('libs/chartboost.jar')
    compile files('libs/applovin-sdk-6.1.5.jar')
    compile files('libs/heyzap.jar')
    compile files('libs/revmob.jar')
    compile project(':appGradeLib')
    //compile project(':sensiblefacebooksdk')
    compile project(':googleplayserviceslib')
    compile files('libs/AdxmiCustomizedSdk_v1.2.0_2015-11-13.jar')
    compile files('libs/AdxmiSdk_v5.4.0_2015-11-12.jar')
    compile project(':unity-ads')
    compile files('libs/org.apache.http.legacy.jar')

    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.vstechlab.easyfonts:easyfonts:1.0.0'
    compile 'com.febaisi:custom-textview:0.0.3'
    compile 'com.scopely:fontain:1.0.0'

    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.android.support:appcompat-v7:25.0.0'

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

您正在使用旧版本的Firebase库。 这些是最新的:

compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'

让google服务使用相同的版本(全部9.4.0或全部10.0.1)

正如@hristoyanov在回答中提到的,您使用的是旧版本的Firebase库。如果我理解的很好,你必须总是使用相同版本的谷歌游戏服务。你可以在这里找到它:而且,不要使用不推荐的版本,比如compile'com.facebook.android:facebook-android-sdk:4.+'和classpath'io.fabric.tools:gradle:1.+'。这只会减慢构建时间,有时会导致错误,因为IDE会不断检查新版本。