14

I want to integrate Firebase Analytics in my project.

I followed the Guide but it gives me this warning:

06-30 18:38:30.514 W/FA      ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:30.888 W/FA      ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.306 W/FA      ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.338 W/FA      ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:38:32.661 W/FA      ( 2091): Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
06-30 18:39:32.680 W/FA      ( 2091): Tasks have been queued for a long time

My project version is:

ext {
minSdkVersion = 17
targetSdkVersion = 23
compileSdkVersion = 23
compileSdkVersionS = 'Google Inc.:Google APIs:23'
supportVersion = '24.0.0'
buildToolsVersion = '23.0.2'
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
gradleVersion = '2.1.2'
playServicesVersion = '9.2.0'
gsonVersion = '2.3'}

The log is print out through

adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC

I think the version I am using now is good enough but I am still getting the error message, can anyone give me a hint on it?

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73
Damon Yuan
  • 3,683
  • 4
  • 23
  • 31
  • The warnings might indicate your Google Play Services needs an update. Are you not also seeing a warning message stating: _Google Play services out of date_? Are you running on an emulator? The version of GPS on my devices is 9.2.56. – Bob Snyder Jun 30 '16 at 15:52
  • 1. I did not see a warning message stating that. 2. It is running on a real device. What should I do then to update the Google Play Service in my cellphone? – Damon Yuan Jul 01 '16 at 01:39
  • You can see the installed version number by going to Settings/Application-Manager and finding Google Play Services. The current version is 9.2.56. You can get the installed version number from code by calling [GoogleApiAvalability.GOOGLE_PLAY_SERVICES_VERSION_CODE](https://developers.google.com/android/reference/com/google/android/gms/common/GoogleApiAvailability). If your installed version is not the latest you can update from the [Google Play Store](https://play.google.com/store/apps/details?id=com.google.android.gms&hl=en). – Bob Snyder Jul 01 '16 at 02:35
  • I'm seeing the same issue but the API doesn't seem to return a PendingIntent for resolving the issue. This is odd because my users don't have a clue on how to proceed! Any ideas on how to give proper feedback to app users? – Niels Jul 14 '16 at 06:37

2 Answers2

10

After posting comments on the question (see above), I experimented running an app built with Firebase 9.2.0 on an emulator that had an old version of Google Play Services. Using the adb commands posted in the question, I saw the same warnings as those included in the question. Also in the normal logcat output was the message:

W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9256000 but found 9080030

You need to update Google Play Services on your device. If you are running Firebase 9.2.0, the required Play Services version is 9.2.56.

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • Is there a way to catch/detect this error while running on a production device? When manually connecting to Google Play Services APIs, one can use [https://developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener#onConnectionFailed(com.google.android.gms.common.ConnectionResult))] for this purpose, but Firebase seems to be making the conn attempt behind the scenes. Many devices in the field are running an out-of-date Google Play Services, so catching this error programmatically and suggesting the update to the user is critical. – CCJ May 09 '17 at 16:26
  • 1
    @CCJ: Use the methods of [GoogleApiAvailability](https://developers.google.com/android/reference/com/google/android/gms/common/GoogleApiAvailability), in particular, `isGooglePlayServicesAvailable()`. – Bob Snyder May 09 '17 at 16:32
  • ah okay. The text of that method reads "Verifies that Google Play services is installed and enabled on this device, and that the version installed on this device is no older than the one required by this client" -- to what client are they referring? Shouldn't the required version be specific to a given Google Play Services API? If so, how can I apply this method to the API(s) that Firebase Analytics requires to ensure that Firebase's API connection attempts won't result in SERVICE_VERSION_UPDATE_REQUIRED status? – CCJ May 09 '17 at 21:26
0

This message means that you need to update Google Play Store app on the device.

If you are using Android Studio Emulator:

  1. Open extended controls by clicking the 3 dots at the bottom of control menu
  2. Select Google Play
  3. Click Update
  4. Inside the emulator click the UPDATE button

After the new version is downloaded and installed this error will be gone.

Babken Vardanyan
  • 14,090
  • 13
  • 68
  • 87