Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FIREBASE_AUTH_API is not available on this device

I have followed the new Google Firebase guide for Facebook sign-in on Android but I am consistently getting the following error on a particular device.

FirebaseAuth:signInWithCredential failed                                                                   
com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device.

On other devices it seems to work fine. The device is Moto X Play running Android 6.0.1. It also has Google Play Services 9.0.83. I tried a complete uninstall and reinstall with no luck.

like image 541
rmp251 Avatar asked May 24 '16 18:05

rmp251


People also ask

Does Firebase authentication still require Google Play Services?

Today, we are pleased to announce that as of version 20.0.0 of the Firebase Authentication Android SDK (which is included in version 26.0.0 of the Firebase Android BoM), Firebase Authentication no longer depends on Google Play services.

What is Firebase SDK for Android?

Some Firebase Android SDKs depend on Google Play services, which means they will only run on devices and emulators with Google Play services installed. These Firebase SDKs communicate with the Google Play services background service on the device to provide a secure, up-to-date, and lightweight API to your app.

Do I need to use my real Firebase project ID?

Note that you do not need to use your real Firebase project ID; the Authentication emulator will accept any project ID. For security reasons, the Authentication emulator issues unsigned ID tokens, which are only accepted by other Firebase emulators, or the Firebase Admin SDK when configured.

How do I connect the firebase admin SDK to the authentication emulator?

The Firebase Admin SDK automatically connects to the Authentication emulator when the FIREBASE_AUTH_EMULATOR_HOST environment variable is set. Note that the Cloud Functions emulator is automatically aware of the Authentication emulator so you can skip this step when testing integrations between Cloud Functions and Authentication emulators.


2 Answers

This was a bug affecting the 9.0.0 and 9.0.1 versions of the SDK. It has been fixed as of SDK version 9.0.2.

Update the Google repository via the Android SDK manager and then change your gradle dependency to: compile 'com.google.firebase:firebase-auth:9.0.2'

See incident details here.

like image 154
Alfonso Gomez Jordana Manas Avatar answered Oct 04 '22 16:10

Alfonso Gomez Jordana Manas


As Alfonso says in the comments, there is an issue we are seeing where some users don't have the Firebase Auth API available even though they have Google Play services 9.0.83.

That's a bug - sorry about that - and is being investigated at the moment. If you're seeing it, please raise an issue in the troubleshooting page with any further details of the device where you had the problem.

like image 43
Ian Barber Avatar answered Oct 04 '22 16:10

Ian Barber