FIREBASE_AUTH_API is not available on this device while signInWith Google Credentials!

5,373 views
Skip to first unread message

malli...@gmail.com

unread,
May 23, 2016, 9:26:47 AM5/23/16
to Firebase Google Group
When I deployed the sample friendlychat app on the device, I get an exception while authenticating a user with Google Account! 
The device is Galaxy Note 5, with Android 6.0.1 and with Google play-services 9.0.83.
Has any one faced similar issue? 

com.xyz.firebase.codelab.friendlychat E/SignInActivity: signInWithCredential
                                                                                                com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device.
                                                                                                    at com.google.android.gms.internal.zznp$zzb.zzv(Unknown Source)
                                                                                                    at com.google.android.gms.internal.zzoj$zzc.zzz(Unknown Source)
                                                                                                    at com.google.android.gms.internal.zzoj$zzc.onConnectionFailed(Unknown Source)
                                                                                                    at com.google.android.gms.internal.zzoj$zzd.zzh(Unknown Source)                                                                                                   
...


The above exception occurs while trying to signInWithCredential the snippet of the code is :
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
Log.d(TAG, "firebaseAuthWithGooogle:" + acct.getId());
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mFirebaseAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());

// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
Log.e(TAG, "signInWithCredential", task.getException());
Toast.makeText(SignInActivity.this, "Authentication failed.", Toast.LENGTH_SHORT).show();
} else {
startActivity(new Intent(SignInActivity.this, MainActivity.class));
finish();
}
}
});
}

Mark Prosser

unread,
May 24, 2016, 3:25:36 PM5/24/16
to Firebase Google Group
I'm getting the exact same issue with Facebook login, also with Android 6.0.1 and Google play services 9.0.83. It occurs on Moto G, however it does not occur on HTC One which is running the same version of Android and GPS. Anyone have any insights?

Alfonso Gomez Jordana Manas

unread,
May 24, 2016, 4:40:31 PM5/24/16
to Firebase Google Group
Mark, can you please drop me an email at alfongj at google com ? We'd like to request you to send us some debugging information so we can reproduce the issue. Thank you

Kevin Gleason

unread,
May 24, 2016, 11:57:30 PM5/24/16
to Firebase Google Group
Having the same issue with the standard email/password authentication.

Any solution to this yet? Currently using the Android password auth tutorial code in my app and I am getting the same - API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device.

Alfonso Gomez Jordana Manas

unread,
May 25, 2016, 10:12:47 PM5/25/16
to Firebase Google Group
Kevin, could you please drop us an email at the address I mentioned above, or via our support helpdesk (mark it with high urgency), so we can help diagnose your issue.

malli...@gmail.com

unread,
May 29, 2016, 4:41:57 PM5/29/16
to Firebase Google Group

I posted the same question to Firebase support team, they suggested to clear Play Services Storage data and cache, as soon as I cleared them, the App started to  worked as expected and allowed to login using a valid Google Account! 


Follow the below step if you run into an exception or error similar to "FIREBASE_AUTH_API is not available on this device" !

--> Clear Google Play Services cache and try again after a few minutes (Settings > Apps > Google Play services > Storage > Manage Space > Clear All Data).


Alfonso Gomez Jordana Manas

unread,
Jun 3, 2016, 5:32:54 PM6/3/16
to Firebase Google Group
Hi everyone. This issue has been fixed in the latest SDK (9.0.2), so clearing data is no longer needed.

To resolve this issue, change your gradle dependency to:
compile 'com.google.firebase:firebase-auth:9.0.2' (ensure your Google repository is up to date using the SDK Manager)

Alfonso Gomez Jordana Manas

unread,
Jun 3, 2016, 5:33:04 PM6/3/16
to Firebase Google Group
Hi everyone. This issue has been fixed in the latest SDK (9.0.2), so clearing data is no longer needed.

To resolve this issue, change your gradle dependency to:
compile 'com.google.firebase:firebase-auth:9.0.2' (ensure your Google repository is up to date using the SDK Manager)

On Sunday, May 29, 2016 at 1:41:57 PM UTC-7, malli...@gmail.com wrote:

Onelio Mapinde

unread,
Jun 4, 2016, 11:07:36 AM6/4/16
to Firebase Google Group
I have same issue with in the web using email and password authenticate, i can authenticate but in firebase show i have authenticate. :)

Jacob Wenger

unread,
Jun 6, 2016, 12:20:35 AM6/6/16
to fireba...@googlegroups.com
Onelio, please start a new thread with a lot more information, including version numbers and any errors you are getting. Code samples are greatly appreciated.

Jacob
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/81919ad9-0bd8-4141-94ba-aa164b0b7bc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roger Odipo

unread,
Jun 9, 2016, 10:39:10 AM6/9/16
to Firebase Google Group

I updated my firebase auth to 9.0.2 and cleared data and cache in Google Play Services but I still have the same error.


  Caused by: java.lang.IllegalArgumentException: Must specify an idToken or an accessToken.
                                                                            at com.google.firebase.auth.GoogleAuthCredential.<init>(Unknown Source)
                                                                            at com.google.firebase.auth.GoogleAuthProvider.getCredential(Unknown Source)
                                                                            at com.rockrussel.houzekiel.Houses.firebaseAuthWithGoogle(Houses.java:269)
                                                                            at com.rockrussel.houzekiel.Houses.handleSignInResult(Houses.java:188)
                                                                            at com.rockrussel.houzekiel.Houses.onCreate(Houses.java:107)

Ishaankhan Pathan

unread,
Jun 11, 2016, 11:35:10 AM6/11/16
to Firebase Google Group
I am facing the same issue, IllegalArgumentException. Have any of you guys found a work around?

Tomer Bu

unread,
Jun 16, 2016, 10:28:46 AM6/16/16
to Firebase Google Group
I Had the same Exception as you mention:

" Must specify an idToken or an accessToken."

The solution was to include the default web client id in the gso token request like so:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();

Ishaankhan Pathan

unread,
Jun 18, 2016, 9:53:19 AM6/18/16
to Firebase Google Group
Thank you, that did work out.
Reply all
Reply to author
Forward
0 new messages