适用于Google服务的Android版本冲突

Adi*_*fyr 4 android version firebase google-play-services firebase-analytics

我已经为此寻找了很多解决方案,但没有一个适合我的确切情况.我在Gradle Sync上收到此错误:

错误:任务':app:processDebugGoogleServices'的执行失败.

请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为11.4.2.

这是我的build.gradle(app)依赖项.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Run Code Online (Sandbox Code Playgroud)

这是我的项目级build.gradle

buildscript {
    ext.kotlin_version = '1.2.10'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.1.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

同样重要的是: 它在此行下方显示一条红线:

implementation 'com.google.firebase:firebase-auth:11.8.0'
Run Code Online (Sandbox Code Playgroud)

如果我将鼠标悬停在上面,我会收到的消息:

所有gms/firebase库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃).发现版本11.8.0,11.4.2.示例包括com.google.android.gms:play-services-auth:11.8.0和com.google.firebase:firebase-analytics:11.4.2

我甚至没有分析依赖!

我该怎么办?

已经尝试过的解决方案

如果我尝试更改我的com.google.android.gms版本,它会给我一个lint说不要将我的整个播放服务捆绑在依赖项中.而且它也没有改变我得到的火力山错误.

将firebase更改为11.4.2将引发一个lint错误.

将Google Play服务版本更改为3.1.1或更低版本将无效.

Gee*_*uri 6

如果我没有错,Google服务依赖于firebase.我认为两者都是矛盾的

检查此firebase.google.com/docs/android/setup并调整google services和firebase依赖关系版本

此外,请确保您在build.gradle (app)文件的底部有这个:

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