Android gms.google.services版本(15.0.1)与Firebase Core 16.0.0冲突 [英] Android gms.google.services version (15.0.1) conflict with Firebase Core 16.0.0

查看:160
本文介绍了Android gms.google.services版本(15.0.1)与Firebase Core 16.0.0冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相似的问题在这里被问了很多,我经历了所有可以找到的问题并尝试了所有的解决方案.

Similar questions have been asked a lot here and I have gone through all of what I can find and tried all of the solutions there.

问题

所有GMS/Firebase必须使用完全相同的版本"-我可以看到以下Google Services库存在版本冲突,这些冲突没有专门针对任何build.gradle文件编写,而与版本16.0.0冲突. Firebase核心库的内容:

"All GMS/Firebase must use the exact same version" - I can see that there is a version conflict for the following Google Services libraries, which arent specifically written on any of the build.gradle files, against version 16.0.0 of the firebase core library:

  • com.google.android.gms:play-services-ads-identifier-15.0.1
  • com.google.android.gms:play-services-base-15.0.1
  • com.google.android.gms:play-services-basement-15.0.1
  • com.google.android.gms:play-services-measurement-base-15.0.4
  • com.google.android.gms:play-services-stats-15.0.1

此处是我的项目级别build.gradle和

Here is my project level build.gradle and here is my app level build.gradle. As you can see, the error message comes from the firebase core dependency.

到目前为止,我已经完成了检查现有堆栈溢出问题和解决方案的操作(mod,请先检查这些尝试,然后再说这个问题是重复的):

  1. SO问题提供了一个确保在SDK Tools/Support Repository下安装了最新的Google Repository的解决方案.我的是最新的58版本.
  2. SO问题此是为了增加Firebase版本以匹配Google服务版本.但是,我的情况则相反(firebase版本高于Google Services版本).因此,当我尝试将Firebase版本降级为Google Services版本时,会出现此错误.但是,我不知道如何升级Google Services版本,因为我已经将Google Services SDK工具升级到了最新版本,并且我在项目级别build.gradle(4.0.1)上添加了最新版本. Google的文档.
  3. SO的解决方案问题是保持所有Firebase依赖版本相同.到目前为止,我仅添加了一个依赖项(即firebase-core),因此在这里不适用.
  4. 一个和
  1. This SO question provides a solution to make sure the latest Google Repository is installed under SDK Tools / Support Repository. Mine is the latest at version 58.
  2. The solution to this SO question and this was to increase the Firebase version to match the Google Services version. However, mine is the other way around (firebase version is higher than Google Services version). So when I try to downgrade the firebase version to the Google Services version, I get this error. However, I dont know how to upgrade the Google Services version because I have already upgraded the Google Services SDK tool to the latest and what I have added on the project level build.gradle (4.0.1) is the latest version as of today from Google's documentation.
  3. The solution to this SO problem was to keep all firebase dependency versions the same. I have only added one dependency so far (ie firebase-core) so it doesnt apply here.
  4. This one and this one says make sure to add apply plugin: 'com.google.gms.google-services' at the end of the app level build.gradle. I have already done that.

推荐答案

尝试更新您拥有的所有内容.从您的SDK Manager,Android Studio等开始.尝试将28用作targetSdkVersioncompileSdkVersion,并将Android Studio Gradle Tools(也取决于您)更新到最新版本.

Try to update everything you have. Start from your SDK Manager, Android Studio, etc. Try to use 28 as targetSdkVersion, compileSdkVersion, and also update Android Studio Gradle Tools (also in your dependency) to the latest version.

然后重建您的项目.

这篇关于Android gms.google.services版本(15.0.1)与Firebase Core 16.0.0冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆