Skip to content

“No eligible accounts can be found” error on sign out despite disabling Smart Lock #1156

@ifeins

Description

@ifeins

Step 1: Describe your environment

  • Android device: Samsung S7
  • Android OS version: 7.0.0 (though it happened on other versions)
  • Google Play Services version: 11.9.75
  • Firebase/Play Services SDK version: 11.8.0
  • FirebaseUI version: 3.2.1

Step 2: Describe the problem:

I'm using Google authentication through Firebase Auth UI to login users to my app.
In the app I'm developing I've added a sign out button which allow the user to switch the associated Google account.
When the sign out button is clicked an exception is thrown (see observed result section).

I've previously opened a StackOverflow thread on this and was asked to open an issue here.
See this thread: https://stackoverflow.com/questions/48529851/firebase-auth-ui-no-eligible-accounts-can-be-found-error-on-sign-out

Observed Results:

The following exception is thrown:

01-30 22:08:39.730 8075-8075/com.ifeins.tenbis E/HomeActivity: signOut: Failed to sign out
java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
 at com.google.android.gms.tasks.Tasks$zzc.zzbjb(Unknown Source)
 at com.google.android.gms.tasks.Tasks$zzc.onFailure(Unknown Source)
 at com.google.android.gms.tasks.zzh.run(Unknown Source)
 at com.google.android.gms.tasks.zzm.execute(Unknown Source)
 at com.google.android.gms.tasks.zzg.onComplete(Unknown Source)
 at com.google.android.gms.tasks.zzl.zzb(Unknown Source)
 at com.google.android.gms.tasks.zzn.setException(Unknown Source)
 at com.google.android.gms.tasks.TaskCompletionSource.setException(Unknown Source)
 at com.google.android.gms.common.internal.zzbl.zzr(Unknown Source)
 at com.google.android.gms.common.api.internal.zzs.zzc(Unknown Source)
 at com.google.android.gms.common.api.internal.zzs.setResult(Unknown Source)
 at com.google.android.gms.internal.zzaul.setResult(Unknown Source)
 at com.google.android.gms.internal.zzauk.zze(Unknown Source)
 at com.google.android.gms.internal.zzaur.onTransact(Unknown Source)
 at android.os.Binder.execTransact(Binder.java:573)
Caused by: com.google.android.gms.common.api.ApiException: 16: No eligible accounts can be found
 at com.google.android.gms.common.internal.zzb.zzy(Unknown Source)
 at com.google.android.gms.common.internal.zzbk.zzz(Unknown Source)
 at com.google.android.gms.common.internal.zzbl.zzr(Unknown Source) 
 at com.google.android.gms.common.api.internal.zzs.zzc(Unknown Source) 
 at com.google.android.gms.common.api.internal.zzs.setResult(Unknown Source) 
 at com.google.android.gms.internal.zzaul.setResult(Unknown Source) 
 at com.google.android.gms.internal.zzauk.zze(Unknown Source) 
 at com.google.android.gms.internal.zzaur.onTransact(Unknown Source) 
 at android.os.Binder.execTransact(Binder.java:573) 

Expected Results:

I expected the sign out to work successfully and not throw an exception.

Relevant Code:

This is the sign out code I'm using:

private void signOut() {
    AuthUI.getInstance()
            .signOut(this)
            .addOnCompleteListener((task) -> {
                if (task.isSuccessful()) {
                    User.setCurrentUser(null);
                    showSignInDialog();
                } else {
                    Log.e(TAG, "signOut: Failed to sign out", task.getException());
                }
            });
}

This is the code I'm using to perform sign in (notice that I disable smart lock):

private void showSignInDialog() {
    List<AuthUI.IdpConfig> providers = Collections.singletonList(
            new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()
    );

    Intent intent = AuthUI.getInstance()
            .createSignInIntentBuilder()
            .setIsSmartLockEnabled(false)
            .setAvailableProviders(providers)
            .build();
    startActivityForResult(intent, RC_SIGN_IN);
}

I've also attempted to disable SmartLock on the device itself but the exception is still being thrown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions