简体   繁体   English

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

[英]Android Version Conflict for Google Services

I've searched for a lot of solutions to this, but none fit my exact case. 我已经为此寻找了很多解决方案,但没有一个适合我的确切情况。 I am getting this error on Gradle Sync: 我在Gradle Sync上收到此错误:

Error:Execution failed for task ':app:processDebugGoogleServices'. 错误:任务':app:processDebugGoogleServices'的执行失败。

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/ ) or updating the version of com.google.android.gms to 11.4.2. 请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息, 访问https://bintray.com/android/android-tools/com.google.gms.google-services/ )或将com.google.android.gms的版本更新为11.4.2。

this is in my build.gradle (app) dependencies. 这是我的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'
}

and this is in my Project level build.gradle 这是我的项目级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
}

Also Important: It shows a red line under this line: 同样重要的是:它在此行下方显示一条红线:

implementation 'com.google.firebase:firebase-auth:11.8.0'

The message I'm getting if I hover over it: 如果我将鼠标悬停在上面,我会收到的消息:

All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 所有gms / firebase库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。 Found versions 11.8.0, 11.4.2. 发现版本11.8.0,11.4.2。 Examples include com.google.android.gms:play-services-auth:11.8.0 and com.google.firebase:firebase-analytics:11.4.2 示例包括com.google.android.gms:play-services-auth:11.8.0和com.google.firebase:firebase-analytics:11.4.2

I don't even have an analytics dependency! 我甚至没有分析依赖!

What do I do? 我该怎么办?

Already tried solutions: 已经尝试过的解决方案

If I try to change my com.google.android.gms version, it will throw me a lint saying not to bundle my entire play services in the dependencies. 如果我尝试更改我的com.google.android.gms版本,它会给我一个lint说不要将我的整个播放服务捆绑在依赖项中。 And it also doesn't change the firebase error I'm getting. 而且它也没有改变我得到的火力山错误。

Changing firebase to 11.4.2 will throw a lint error. 将firebase更改为11.4.2将引发一个lint错误。

Changing google play services version to 3.1.1 or below will do nothing. 将Google Play服务版本更改为3.1.1或更低版本将无效。

If I am not wrong, Google services have the dependency on the firebase. 如果我没有错,Google服务依赖于firebase。 I think both are conflicting 我认为两者都是矛盾的

check this firebase.google.com/docs/android/setup and adjust google services and firebase dependency versions 检查此firebase.google.com/docs/android/setup并调整google services和firebase依赖关系版本

Also, make sure you have this at the bottom of your build.gradle (app) file: 另外,请确保在build.gradle (app)文件的底部有这个:

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

You might have some third party library in your project using the com.google.firebase:firebase-analytics:11.4.2 version of Analytics. 您可能在项目中使用com.google.firebase:firebase-analytics:11.4.2版本的Analytics中包含一些第三方库。 Try to find that. 试着找到它。

Try changing it from 11.8.0 to 11.4.2 works for me. 尝试将它从11.8.0改为11.4.2。 old values 旧的价值观

implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'

new values 新的价值观

implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'

change this 改变这一点

 implementation 'com.google.firebase:firebase-auth:11.8.0'

to

compile'com.google.firebase:firebase-auth:11.8.0'

and make sure that in your applevel build.gradle all google and firebase dependency version should be the same. 并确保在你的applevel build.gradle中所有谷歌和firebase依赖版本应该是相同的。

it doesnt works try removing google dependency from applevel build.gradle 它不起作用尝试从applevel build.gradle中删除谷歌依赖

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Google Services插件版本冲突 - Android google services plugin version conflict Google服务版本冲突 - Version conflict of google services Google服务版本冲突 - Google Services Version conflict 通过更新google-services版本或更新com.google.android.gms版本来解决版本冲突 - fix the version conflict either by updating the version of the google-services or updating the version of com.google.android.gms 通过更新google-services插件的版本或将com.google.android.gms的版本更新为8.3.0产生冲突 - conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 8.3.0 通过更新google-services的版本发生冲突 - Conflict by updating the version of the google-services 版本冲突(Google服务插件) - Version conflict (google-services plugin) 解决版本冲突-Google-Services - Fix the version conflict - google-services Android Gradle:添加firebase:firebase-core后,google-services插件的版本冲突 - Android Gradle: Version conflict of the google-services plugin after added firebase:firebase-core 请通过更新google-services插件的版本或将com.google.android.gms更新到9.4.0来解决版本冲突。 - Please fix the version conflict either by updating the version of the google-services plugin or updating com.google.android.gms to 9.4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM