React-native-firebase: Add guide for configuring Google Play Services

Created on 29 Jun 2017  Â·  7Comments  Â·  Source: invertase/react-native-firebase

The Android emulator I am using has Google Play Services 10.9.30 (from Settings -> Apps -> App Info -> Google Play Services). The setup instructions ask the user to link v11.0.0 of the Firebase libs, which gives the error "[app-name] won't run unless you update Google Play Services" - which can only be done by updating the API version of the emulator to the latest one (API 26 at the moment).

I got my app running by replacing:

android/app/build.gradle

    compile "com.google.firebase:firebase-core:11.0.0"
    compile "com.google.firebase:firebase-auth:11.0.0"
    compile "com.google.firebase:firebase-crash:11.0.0"
    compile "com.google.firebase:firebase-database:11.0.0"
    compile "com.google.firebase:firebase-messaging:11.0.0"
    compile "com.google.firebase:firebase-storage:11.0.0"
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules

with:

android/app/build.gradle

    compile "com.google.firebase:firebase-core:10.0.1"
    compile "com.google.firebase:firebase-auth:10.0.1"
    compile "com.google.firebase:firebase-crash:10.0.1"
    compile "com.google.firebase:firebase-database:10.0.1"
    compile "com.google.firebase:firebase-messaging:10.0.1"
    compile "com.google.firebase:firebase-storage:10.0.1"
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules

Note that Firebase:Perf does not work with this setup.
Can we have this documented?

Most helpful comment

You can login to the play store in your simulator and update google play services.
Downgrading the version of firebase not the right solution.

All 7 comments

You can login to the play store in your simulator and update google play services.
Downgrading the version of firebase not the right solution.

Do not downgrade your firebase.
If client have old play services, they have to update to latest version

@akshetpandey there is no Google Play Store in Android Emulator (7.1, API 26). I tried many ways to upgrade it but there seems to be no solution.

You can try using Android Studio 3, you can build the emulators with the
play store installed. Then just ensure Google Services is running the
latest update.

On 30 Jun 2017 7:51 am, "Ashish Chaudhary" notifications@github.com wrote:

@akshetpandey https://github.com/akshetpandey there is no Google Play
Store in Android Emulator (7.1, API 26). I tried many ways to upgrade it
but there seems to be no solution.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/216#issuecomment-312189930,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzZXtLJDwmEivgVi4qO9yiBP-v1riPiks5sJJregaJpZM4OJjvu
.

This seems to be possible in Android Studio 3. Thanks.

I'll get something added to the docs.

I've just gone through this process and had a couple of quetions/comments:

  1. I'm not exactly sure how I upgraded to a later version of Google Services on a marshmallow emulator as I never did do anything explicitly in AVD in the end. I did go to Android Studio 3 RC2 so whether this in itself did it?
  2. I still unfortunately couldn't get my app running, with a general "unable to run app" message in my Marshmallow emulator. Nothing in the react-native logs (i.e. react-native log-android). Any ideas here?
  3. The app does run in the latest Android "O" version however. Is this ok to test on "O" noting the react-native doc's always refer to using Marshmallow? (It also does run on my physical device)
Was this page helpful?
0 / 5 - 0 ratings