com.google.android.gms中build.gradle中的冲突

时间:2018-03-26 10:24:54

标签: java android android-gradle build.gradle

当我尝试运行我的应用时出现此错误

  

错误:任务':app:processDebugGoogleServices'的执行失败。   请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/提供有关最新版本的信息)或将com.google.android.gms的版本更新为11.8.0来修复版本冲突。

但是我已经将gms升级到我错误的最新版本?你能解释一下吗?

这是我的build.gradle

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.facebook.android:facebook-android-sdk:4.16.0'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.yalantis:ucrop:2.2.1'
    compile 'com.android.support:design:23.3.0'
    //compile 'com.google.android.gms:play-services-gcm:11.0.4'
    compile 'com.google.android.gms:play-services:11.8.0'
    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.writingminds:FFmpegAndroid:0.3.2'
    compile 'com.google.apis:google-api-services-youtube:v3-rev186-1.23.0'
    compile group: 'com.google.oauth-client', name: 'google-oauth-client-java6', version: '1.23.0'
    compile group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.23.0'
    compile 'com.github.PierfrancescoSoffritti:AndroidYouTubePlayer:4.1.7'
    //compile "android.arch.lifecycle:runtime:1.0.0-alpha2"
    //compile "android.arch.lifecycle:extensions:1.0.0-alpha2"
    compile 'com.google.code.gson:gson:2.8.2'
    compile 'com.netflix.rxjava:rxjava-android:0.16.1'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.0'
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile group: 'com.google.api-client', name: 'google-api-client', version: '1.22.0'
    compile group: 'com.google.api-client', name: 'google-api-client-android', version: '1.22.0'
    implementation "android.arch.lifecycle:livedata:1.1.1"
    implementation "android.arch.lifecycle:viewmodel:1.1.1"
    implementation "android.arch.lifecycle:extensions:1.1.1"
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    testCompile 'junit:junit:4.12'
}

1 个答案:

答案 0 :(得分:3)

 compile 'com.google.android.gms:play-services:11.8.0'
 compile 'com.google.firebase:firebase-core:11.0.4' XX

上述两个版本为 DIFFERENT

使用

 compile 'com.google.android.gms:play-services:11.8.0'
 compile 'com.google.firebase:firebase-core:11.8.0'

代替

并添加

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

底部 顶部 !!