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

Execution failed for task processDebugGoogleServices or version conflict either by updating the version of the google-services plugin

将 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 depenmdencies

  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"
    }

所有 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'