简体   繁体   English

谷歌播放服务版本在应用程序中与第三方库发生冲突

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

I used third party library (.jar) which has dependencies on play-services:6.5.87 and my main app module use play-services-gcm:8.3.0 which is latest version. 我使用了依赖于play-services的第三方库(.jar) :6.5.87而我的主app模块使用play-services-gcm:8.3.0这是最新版本。 Both upgrading to 8.+ from 6.+ and downgrading from 8.+ to 6.+ doesn't work and have build error. 6. +升级到8. +并从8. +降级到6. +都不起作用并且存在构建错误。

Please do comment if you find my question confused, i will try provide detail explanation as much as i can . 如果您发现我的问题困惑,请发表评论,我会尽可能多地提供详细说明。 Thanks 谢谢

After couples hours of googling , i figured out to run successfully. 经过几个小时的谷歌搜索,我想出来成功运行。 Google has made update on google-play-services api in 8.+ and remove some of the impl which they once had in 6.+ but 7.+ don't. Google已经在8. +上对google-play-services api进行了更新,并删除了他们曾经在6. +但是7. +中没有的一些impl。 See here for play service api release notes . 请参阅此处了解播放服务api 发行说明 Since third party library use google location service .My app has depend on new impl of GCM ( 8.+) . 由于第三方库使用谷歌位置服务。我的应用程序依赖于GCM的新impl (8. +) Changing version to 7.8.0 esp solve my issue . 将版本更改为7.8.0 esp解决了我的问题。

Things learned here is if you don't neccessary have to depend on third party which use seperate google-play-service, don't waste time on that. 这里学到的东西是,如果你不需要依赖使用单独google-play-service的第三方,不要浪费时间。 Otherwise use alternative library. 否则使用替代库。 Beacause the only way you solve this prob is , ask library supporter to build (.aar) version with latest google-play-servies . 因为解决这个问题的唯一方法是,请求库支持者使用最新的google-play- servies构建(.aar)版本。 If not you may fall into the same issue I did. 如果不是,你可能会遇到同样的问题。

Hopt it helps Hopt有帮助

check your build.gradle file and android build version. 检查你的build.gradle文件和android构建版本。

compile 'com.google.android.gms:play-services:8.1.0'//updated version you can put and check android build version you installed. 编译'com.google.android.gms:play-services:8.1.0'//您可以放置​​更新版本并检查您安装的android版本。

compile 'com.google.android.gms:play-services-gcm:8.1.0'//updated version you can put. 编译'com.google.android.gms:play-services-gcm:8.1.0'//您可以添加更新版本。 or 要么

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

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM