Do devices keep more than 1 version of Google Play services? - android

I updated one of my apps a few months ago to version 8.3.0 of Google Play services, and that version broke backwards compatibility for some location related APIs.
So my question is, if my device already had Google Play services 8.3.0 installed even when I was running my app using version 6.5.87, how is it possible that it was still working? (Given that the APIs on 6.5.87 are no longer available on 8.3.0) Do devices keep older versions of Google Play services to support backwards compatibility? Or are the removed APIs somehow available on the installed version of Google Play services and hidden on the library shared with developers?
What I'm trying to understand here is if updating Google Play services on my app actually brings background improvements to the app (like using the latest algorithms in the library), or if those improvements are already available as soon as the device installs the new Google Play services version.
EDIT:
After looking into this in more detail I saw that no APIs were actually broke, however some interfaces were converted into abstract classes (see https://developers.google.com/android/guides/releases#september_2015_-_v81) and that is what caused the compilation issues I had back then.
The issue I had happened because version 8.1 of Google Play services was no longer compatible with older versions (because of the change mentioned above), so all the libraries I was using had to be built with 8.1+, if one of them was built with an older version then the compilation failed with this error:
java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
EDIT 2:
Even though the issue I faced was not about removed APIs, I found an example of an API that was removed on Google Play services version 7: GooglePlayServicesClient (see Cannot resolve symbol 'GooglePlayServicesClient').

In the release notes of of Google Play Services 8.3 I don't see any note on API calls not available anymore. My guess is that the calls are just deprecated and not removed.

its not automatically available for your app
when update Google play service version you must have to update your app with new version of Google play service code only then your app have new algorithm
if your app have old version of Google play service & device have new version: don't worry your app works fine because your app already have Google play service code in your APK.(device don't keep old version code of Google Play service when update to new one).
if your app have new version of Google play service & device have old: then you must have to ask user update Google play service in his/her device then your app work fine in his/her device
so, its not necessary to device must have more then one version of Google Play service
EDITED: 12-01-2015
I already give you answer of this but still i w'll give you example
I have used Google play service(v 7.8.0) in my app for Location(com.google.android.gms:play-services-location:7.8.0) and for maps(com.google.android.gms:play-services-maps:7.8.0) and current Google Play service Version is 8.4.0 still my app working file why? because some of google play service code attach with my APP code see image below.
I have extract code from APK file. see Google play service code available with APK see package name com.google.android.gms that's why my app wok fine without any issue.
you can also generate your app code see this answer for more detail;

Related

<Your App> is having trouble with Google Play services.Please try again. Only on 4.4.X OS devices

We have an android app on Play Store for last 2 years. We are trying to connect the Google Drive API using play services inside the app.
Things are working fine for all the android OS except 4.4.X. In 4.4.X OS devices while trying to login to the Google Account most of the users are getting the error (as reported by them) like :
" is having trouble with Google Play services.Please try again."
Does anyone know how to fix this issue?. This is Not reproducing on all 4.4.X devices.
If you are having troubles with your virtual devices when running things like Google maps etc.; try creating a new virtual device with Google Play Store incorporated
On your Android phone, go to Settings.
Click on Apps.
Click Google Play services.
Click on Permissions.
Ensure all permission settings are turned on.
I've had the same issue as reported above after updating my app dependencies from com.google.android.gms:play-services-maps:15.0.1 to ..:16.1.0 (or ..:17.0.0). The problem for was that the installed version of Google Play Services on my device (a Zebra TC51 running Android 6.0.1 in this case) is rather old and is managed by our customer using a mobile device management solution (MDM) that is very conservative. Rolling back to ..:15.0.1 or updating Google Play Services to the latest version would both solve this issue for me. Sadly, I cannot force our customers to update Google Play Services (although I'd like them to update obviously).
Reproducing this is straightforward by just installing an older Google Play Services (download the July 2018 version for example, v12.8.74. Set your dependency to 16.0.1 or newer and you'll get the above error message.
I haven't been able to find an overview that lists the compatibility between versions of the installed Google Play Services APK and which versions of the com.google.android.gms:play-services-maps dependency are supported.
Also, have a look at the Overview of Google Play Services where it is explained how the included dependency (in your app) and the installed client library (on the device) depend on one another.
Make sure your Google Play Services is updated
For me worked: Settings > Apps and Notifications > Google Play Store > Permissions > All ON
I fixed this by following the instructions on setting up Firebase on a new project. I encountered the "Try again" prompt until I added firebase-core to the project.
Opening google maps once and the trying my map fixed the problem

Google Play Services SDK (version 38) update

First of all: I am a Software Testing Engineer, so I don't create applications. I use Android Studio for AVD creation, than I install already developed apk file on Android Emulator and make tests. About a month ago I have noticed an annoying pop-up "Update Google Play services" and when I clicked "Update" button - nothing happened.
I don't want to describe all my struggles, but finally I decided that root cause is the outdated Google Play Services SDK (now I have version 38). Android Studio doesn't offers me to update it, and also I can't find any information about version 39. Maybe you know something about this and can help me?
You can always check here the latest version of Google Play service. This is the official documentation of Google Play service that shows you the update and the highlights of each version. This page also shows you how to use the Google Play services APIs in the Android studio.
Note that to test your app using the Google Play services SDK, you must use either:
A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

Upgrade Google Play Service on android emulated device [duplicate]

This question already has answers here:
updating Google play services in Emulator
(12 answers)
Closed 4 years ago.
I'm developing an application with android studio and i use an emulated android device to test it. The emulated device is Nexus 4 with Android 4.4 (with google apis).
In my project, i use the lastest play service client version, the 9.2.0:
When i launch my app on emulator, following message appeare:
The question is: how can i upgrade play service on emulator? Tnx
Just add Google Play Services to you project. To make the Google Play Services API's available to your app, add a new build rule under dependencies for the latest version of play-services.
Open the build.gradle file inside your application module directory.
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services:9.2.0'
}
Be sure you update this version number each time Google Play services is updated.
As described in the Google Play services overview, Google Play delivers service updates for users on Android 2.3 and higher through the Google Play Store app. However, updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.
Because each app uses Google Play services differently, it's up to you decide the appropriate place in your app to verify the Google Play services version. For example, if Google Play services is required for your app at all times, you might want to do it when your app first launches. On the other hand, if Google Play services is an optional part of your app, you can check the version only once the user navigates to that portion of your app.
You are strongly encouraged to use the GoogleApiClient class to access Google Play services features. This approach allows you to attach an OnConnectionFailedListener object to your client. To detect if the device has the appropriate version of the Google Play services APK, implement the onConnectionFailed() callback method. If the connection fails due to a missing or out-of-date version of the Google Play APK, the callback receives an error code such as SERVICE_MISSING,

Using Google Play Services 7.x with Android 6

We upgraded to Google Play Services 8.1 the moment it was out, but now we're considering using a third party library which still has a 7.8 dependency: it hasn't made the required upgrade mentioned here.
Reading over the announcement for Google Play Services 8.1 there is a mention that
If your app is using Google Play services SDK versions prior to 8.1, you must update to use this new version to ensure your app is fully compatible with Android 6.0. This will enable you to manage the permission flows appropriately for your app and avoid any potential connection issues.
Potential connection issues sounds like GCM might stop working, but I haven't found any documentation saying what would actually happen if an Android 6 device tried to use Google Play Services 7.x. Has anyone else run into this? Are there any connection issues that I should be concerned about?

Need apk for Google Play services with version 4132500

I have an app that is making use of the latest google play services sdk.
The emulators don't seem to come with the latest pre installed, and the 'update' link that pops up during the version check, does not respond.
There are lots of similar questions around these issues, and they all have the same answer, where the apk needs to be installed manually (ie. http://hintdesk.com/how-to-install-google-maps-in-android-emulator-and-use-it-in-intellij-idea/).
However it seems all these other pages refer to older apk versions. I'm using platform v. 4.4.2, API level 19. using 4.4.2 emulator, and getting this exact version error: "Google Play services out of date.Requires 4132500 but found 4033530"
I have tried 2 different sets of vendor and gms apks. ones with date 19032013, and ones with date 20130716
These resulted in the same error but an even older version found:
"Google Play services out of date.Requires 4132500 but found 3025110"
"Google Play services out of date.Requires 4132500 but found 3159132"
BTW, I was also getting the "Failure" issue when trying to uninstall the apks using adb.. I switched to the non API emulator, and was able to uninstall / install other apks.
The "failure" issue is mentioned in the comments of:
Trouble using Google sign-in button in the emulator
I think it's just a matter of using those common steps, but we need newer apk files. How do we get a hold of the ones for version 4132500 ?
I don't want to use the older sdk.. and I don't want to use my real device.. I really need to get the emulator working on the latest sdk.
Does anyone have a line on version 4132500 apks? Or does someone know another way to update google play services on the emulator?

Categories

Resources