【问题标题】:Android Studio all gms/firebase libaries must use the exact same versionAndroid Studio 所有 gms/firebase 库必须使用完全相同的版本
【发布时间】:2018-05-04 00:38:09
【问题描述】:

这是我的 Gradle:app 文件

我尝试重建时遇到的错误: “所有 gms/firebase 库必须使用完全相同的版本规范。找到版本 11.6.0、10.2.0。示例包括 com.google.android.gms:play-services-auth:11.6.0 和 com.google.android。 gms:play-services-location:10.2.0"

有人知道如何摆脱错误吗?

【问题讨论】:

  • 除此之外,您所有的 support 库都必须使用相同的版本。最好清理一下,design 支持库被提到了两次。

标签: java android android-studio


【解决方案1】:

运行 ./gradlew app:dependencies 以查看您的传递依赖项是什么(例如,这将显示 lib 依赖于 10.2.0

【讨论】:

  • 它是 'com.frosquivel:magicalcamera:5.0.3',但我需要那个相机。有什么方法可以使用 Magical 相机和 Google Play 服务?
  • @kac26 按照 Rainmaker 的建议,尝试手动将位置依赖项包含在较新版本中:compile "com.google.android.gms:play-services-location:11.6.0"。它应该“覆盖”传递依赖。
  • @A.K.S.H 我试过了,但我得到了同样的错误。没有任何变化。
  • @kac26 在这种情况下尝试排除传递依赖:compile('com.frosquivel:magicalcamera:5.0.3') { exclude 'com.google.android.gms:play-services-location' }
  • @A.K.S.H 我解决了!我将编译更改为 compile('com.frosquivel:magicalcamera:5.0.3') { exclude(group: 'com.google.android.gms') } 它开始工作了!谢谢!
【解决方案2】:

我可以看到您在 gradle 中添加了 com.google.android.gms:play-services-auth:11.6.0 依赖项,但没有添加 com.google.android.gms:play-services-location 。尝试将 compile "com.google.android.gms:play-services-location:11.6.0" 添加到您的依赖项中,同步并重建项目并清理与其他依赖项的混乱

【讨论】:

    【解决方案3】:

    我对依赖版本也有同样的错误:

    compile com.google.firebase:firebase-core:11.6.2'
    

    我通过添加这个缺失的依赖项解决了它:

    compile 'com.google.android.gms:play-services:11.6.2'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-12
      • 2018-10-10
      • 2018-10-16
      • 1970-01-01
      • 2019-08-07
      • 2017-08-22
      • 2019-07-05
      相关资源
      最近更新 更多