我在Android项目中使用Firebase Auth UI(com.firebaseui:firebase-ui-auth:3.1.2
)并在退出时收到以下错误:
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)
这是我用来执行退出的代码:
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());
}
});
}
这是我用来执行登录的代码(请注意我禁用智能锁定):
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);
}
有什么我应该做的不同吗?