8

I am developping an Android application using Firebase Authentication (using Google account) and I recently experience the following exception every time I try to connect:

com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device. at com.google.firebase.zza.zzz(Unknown Source) at com.google.android.gms.internal.zzzq$zzd.zzy(Unknown Source) at com.google.android.gms.internal.zzaap$zza.zzC(Unknown Source) at com.google.android.gms.internal.zzaap$zza.onConnectionFailed(Unknown Source) at com.google.android.gms.internal.zzaap$zzb$1.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:730) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:176) at android.os.HandlerThread.run(HandlerThread.java:61)

I'm quite surprised since the authentication worked very well until a few days ago...

I use firebase 10.0.1.

Do someone have ever experienced this error and resolved it?

quent
  • 1,936
  • 1
  • 23
  • 28

5 Answers5

9

I think you are using your phone as a emulator. So, on your phone,

  1. Go to your Google Play Services.
  2. Open its App Info.
  3. Clear the Data and Cache.

path: --> (Settings > Apps > Google Play services > Storage > Manage Space > Clear All Data).

open the app after few minutes.

Swarup Rajbhandari
  • 466
  • 1
  • 6
  • 14
8

Maybe your emulator doesn't have google play

amorenew
  • 10,760
  • 10
  • 47
  • 69
1

You have to install google play for virtual machine.
For Ex:go to google search: "install google play service for genymotion" , and it will be guide you to install

Hồng Phúc
  • 408
  • 3
  • 10
  • For it to work on the virtual machine, the virtual machine must be installed services of google, so just installs for it. – Hồng Phúc Sep 18 '18 at 00:43
1

Check In your build.gradle (Project) > Repository have following code

mavenCentral()

Check In your build.gradle (Module: app) > dependencies have following code

implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
Mahinthan177
  • 774
  • 1
  • 9
  • 9
0

You get this error bcz your device not having 'Google play services' so that it can't integrate with.. For those who have been using Genymotion virtual or other(Other than Android studio emulator itself) they need to add these services(Play store, Google, etc).. For this search 'How to install Google play services in Genymotion emulator'

Sometime you also get Default firebase is not initialized in this process for this you must upgrade your classpath and dependency both in gradle script (project and module app respectively) ...

classpath 'com.google.gms:google-services:-.-.-' implementation 'com.google.firebase:firebase-auth:-.-.-'