10

I am trying to implement firebase in android project but always getting:
Google Play services out of date. Requires 9877000 but found 9683480
My graddle project/app files look like:

...
compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.google.firebase:firebase-database:9.8.0'
    compile 'com.google.firebase:firebase-auth:9.8.0'

}

apply plugin: 'com.google.gms.google-services'

and

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.google.gms:google-services:3.0.0'

I created Nexus S emulator with API 23 and Target: Android 6.0 (Google APIs) x86_64

Inside emulator Google App Services version is 9.6.83

What should I do to be able to run firebase as don't know what to install or update anymore :/
I am new to android and don't know if I am missing something small.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1110
  • 7,829
  • 55
  • 176
  • 334

2 Answers2

16

The updated Android tools (which contains the Android Emulator system image) isn't out yet. Only once that is out will your emulators have Google Play Services 9.8, which is a prerequisite for Firebase SDK 9.8.

If you want to test on an emulator, you will have to downgrade your app to Firebase SDK 9.6 for the moment.

If you deploy to a physical device, it'll likely already have the latest version.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • What do you mean by latest SDK? I installed fresh android studio. In SDK manager there is nothing to update. I installed Android 6.0 (API 23) Intel x86 Atom 64 System Image. What else should I install to get latest GPServices in emulator? – 1110 Oct 25 '16 at 21:29
  • Hmmm.... I'm not sure the an emulator image with the latest Play Services is available yet. Let me check... – Frank van Puffelen Oct 25 '16 at 21:43
  • Yeah, I just double-checked: the emulator images with 9.8 aren't out yet. For the moment you'll need to either test on a physical device or stick to the 9.6 SDK. Thanks for flagging this btw! – Frank van Puffelen Oct 25 '16 at 22:12
  • So for now we can't use 'firebase-core:9.8.0'. Can you hint me what version of firebase can be run with play service 9.6? – 1110 Oct 25 '16 at 22:20
  • That would be version 9.6 of the Firebase Android SDK. :-) The version numbers of the Firebase SDK and Google Play Services are aligned. – Frank van Puffelen Oct 25 '16 at 22:22
  • Any follow up on this? Where do I get to follow the update channel on GMS updates? – Atu Nov 09 '16 at 07:14
  • 2
    Today, 11/10 there’s updated Google APIs that supports the emulator using google play services 9.8. ! – Dan McNerthney Nov 10 '16 at 18:43
  • Thanks for confirming that Dan! I hadn't heard it yet. – Frank van Puffelen Nov 10 '16 at 22:01
  • 2
    Can somebody confirm that the latest google api's update works? I just downloaded the latest update for Nougat v 25, but continue to get the same error: "Google Play services out of date. Requires 9877000 but found 9875470". However, I am able to run on v24 (MarshMallow) and v19 (KitKat) system images now, so at least I can run on emulator now. – frede Nov 16 '16 at 20:42
0

A possible walkthrough would be to downgrade the emulator's API version (e.g. from 23 to 20) by creating a new emulator (Tools -> Android -> AVD Manager -> Create New Virtual Device. On the second screen, select your prefered (e.g. 20) API version.

george mano
  • 5,948
  • 6
  • 33
  • 43