通过更新google-services插件的版本,任务processDebugGoogleServices或版本冲突的执行失败

时间:2018-02-21 05:19:31

标签: android firebase google-play-services android-support-library

将Google库版本从9.6.0更新为11.8.0时 它创建了很多问题,我无法编译代码。

请参阅以下模块Gradle文件依赖项

compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:support-v13:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.android.support:customtabs:27.0.1'

//noinspection GradleCompatible
compile 'com.google.android.gms:play-services-analytics:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.google.firebase:firebase-crash:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'

及以下是项目gradle依赖项

  dependencies {
//        classpath 'com.android.tools.build:gradle:2.0.0-rc1'
//        classpath 'com.google.firebase:firebase-plugins:1.1.1'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'com.android.tools.build:gradle:3.1.0-alpha06'
        classpath 'com.google.gms:google-services:3.1.0'
        classpath "io.realm:realm-gradle-plugin:3.0.0"
    }

1 个答案:

答案 0 :(得分:2)

所有Google图书馆版本都应该具有相同的版本:

变化:

compile 'com.android.support:appcompat-v7:26.0.2'

为:

compile 'com.android.support:appcompat-v7:27.0.1'

compile 'com.google.firebase:firebase-crash:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'

为:

compile 'com.google.firebase:firebase-crash:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'