Google应用中播放服务版本与第三方库冲突

Google play services version conflict in app with third-party library

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

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

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

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

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

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

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

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

希望有帮助