question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Various exceptions in signInAnonymously()

See original GitHub issue

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.5.1
  • Firebase Component: Auth
  • Component version: 19.1.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I authenticate users anonymously with signInAnonymously() and added a log of exceptions to my server from addOnFailureListener() after many reports that something isn’t working. I got 5 kinds of exceptions, none of which I could not find how to fix. It looks like a bug. Here are they:

  • com.google.firebase.FirebaseException: An internal error has occurred. [ 7: ]
  • com.google.firebase.FirebaseApiNotAvailableException: Error resolution was canceled by the user, original error message: CANCELED: null
  • com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device. Connection failed with: c{statusCode=SERVICE_INVALID, resolution=null, message=null}
  • com.google.android.gms.common.api.ApiException: 8: The connection to Google Play services was lost
  • com.google.firebase.g: A network error (such as timeout, interrupted connection or unreachable host) has occurred.

First is the most popular. The latter is not necessarily a bug, but I do not know how they were able to send a log to the server if they do not have Internet.

Relevant Code:

FirebaseAuth.getInstance().signInAnonymously()
                    .addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                        @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {
                            if (task.isSuccessful()) {
                                FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();

                               // ...
                            }
                        }
                    })
                    .addOnFailureListener(new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception e) {
                            // log exception to server

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:28

github_iconTop GitHub Comments

1reaction
artsemionovcommented, Nov 14, 2019

Nope, it’s back. Seems crashlytics had a few hours delay.

1reaction
artsemionovcommented, Nov 10, 2019

No, it seems. It’s been 15 days since I created the report, looks like we were left with this bug alone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

signInAnonymously:FAILURE com.google.firebase.auth ...
Despite I have enabled in my Firebase project anonymous sign in, my mobile (Android) app is not able to authenticate and I'm getting...
Read more >
Authenticate with Firebase Anonymously on Android
You can use Firebase Authentication to create and use temporary anonymous accounts to authenticate with Firebase. These temporary anonymous accounts can be ...
Read more >
Using Firebase Authentication - FlutterFire
Firebase Auth provides many methods and utilities for enabling you to ... To get started, call the signInAnonymously() method on the FirebaseAuth instance:....
Read more >
An internal error has occured. - Google Groups
//Control reaches here and prints the exception as stated above. Log.d(Constants.TAG, "onError:: Code : "+ task. ... I am using signInAnonymously().
Read more >
Super Simple Authentication Flow with Flutter & Firebase
try/catch is used to catch any exceptions. We can use this to alert the user if sign-in fails. await FirebaseAuth.instance.signInAnonymously() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found