How can i use older version of google play services?

混江龙づ霸主 提交于 2019-12-19 09:52:49

问题


I'm using Google Cloud messaging through google play services. The things is it only works on the devices with last version of play services installed, in remaining devices i need to show a dialog to send user to google play to install new version witch i really don't want to do!

So how can i avoid this?! I'm trying to use an older version of play services (lets say from 2 years ago) to insure majority of my users don't need to update but it seems impossible with grade and android sdk since it already deleted older versions! So what should i do? Is there any way to use older versions?! and if do find a way to use an older version are newer versions compatible with older one?

I don't want to force my users to update because

  • GCM it's not essential to my app although i like to have it!

  • It's over 30 MB witch is a lot in third world countries were my users are.

  • Google play blocks some of my users from accessing google play due to international lows! and i have to do update manually my self!

回答1:


There is a solution for android studio:

1.Close your project

2.Browse to the folder where your projects has been saved

3.Go to folder 'app' and open the file 'build.gradle'

  1. find this line :

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

and change the version (here 7.3.0) to an older one (like 6.5.87). You can find out available versions by looking at sdk/extras/google/m2repository/com/google/android/gms/play-services

5.open the project again




回答2:


Unfortunately Google Cloud Messaging was only added to the Play Services API in version 7.5, which was released end of May 2015 (see this Android Developers Blog post).

So, if you manage to find a copy of the v7.5 API (see my question regarding that here) or if the suggestion above by @Babak is safe (still investigating that one... and you can only go down to 7.5.0 before you lose GCM support), you might be able to gain a few months, but it will likely not make a huge difference...

Actually, I just noticed that your question was also posted end of May... So you probably won't be able to gain anything. But you may reduce support of you move to a new API version later!



来源:https://stackoverflow.com/questions/30556787/how-can-i-use-older-version-of-google-play-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!