【问题标题】:Google play services version conflict in app with third-party library应用程序中的 Google Play 服务版本与第三方库冲突
【发布时间】:2016-03-22 14:33:45
【问题描述】:

我使用了第三方 library (.jar),它依赖于 play-services:6.5.87 并且我的主应用程序模块使用 play-services-gcm:8.3.0这是最新版本。从 6.+ 升级到 8.+ 和从 8.+ 降级到 6.+ 都不会t 工作并且有构建错误。

如果您对我的问题感到困惑,请发表评论,我会尽力提供详细的解释。谢谢

【问题讨论】:

    标签: android google-play-services version build-error


    【解决方案1】:

    经过几个小时的谷歌搜索,我发现可以成功运行。 Google 在 8.+ 中更新了 google-play-services api,并删除了他们曾经在 6.+ 中的一些 impl但是7.+不要。有关播放服务 api release notes 的信息,请参见此处。由于第三方库使用 google 位置服务。我的应用依赖于 GCM (8.+) 的新实现。将版本更改为 7.8.0 esp 解决了我的问题。

    这里学到的东西是,如果您不必依赖使用单独的 google-play-service 的第三方,请不要在这上面浪费时间。否则使用替代库。因为您解决此问题的唯一方法是,请图书馆支持者使用最新的 google-play-servies 构建 (.aar) 版本。如果不是,您可能会遇到与我相同的问题。

    希望有帮助

    【讨论】:

      【解决方案2】:

      检查您的 build.gradle 文件和 android 构建版本。

      compile 'com.google.android.gms:play-services:8.1.0'//可以放的更新版本 并检查您安装的 android build 版本。

      compile 'com.google.android.gms:play-services-gcm:8.1.0'//你可以放的更新版本。 或

      go file->project structure-> dependency tab -> add Library dependency(available google play services)
      

      【讨论】:

      • 当前的 android 构建版本是 buildToolsVersion "22.0.1" 。你是说简单地把 'com.google.android.gms:play-services:8.1.0' , 'com.google.android.gms:play-services-gcm:8.1.0' 放在 gradle 中?
      • 或者去文件->项目结构->依赖选项卡->添加库依赖(可用的google play服务)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      • 2012-04-18
      • 1970-01-01
      • 2019-04-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多