-
Notifications
You must be signed in to change notification settings - Fork 1.9k
“No eligible accounts can be found” error on sign out despite disabling Smart Lock #1156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ifeins thanks for raising this. So @NonNull
public Task<Void> signOut(@NonNull Context context) {
mAuth.signOut();
return Tasks.whenAll(
signOutIdps(context),
GoogleApiUtils.getCredentialsClient(context).disableAutoSignIn());
} and private Task<Void> signOutIdps(@NonNull Context context) {
try {
LoginManager.getInstance().logOut();
} catch (NoClassDefFoundError e) {
// Do nothing: this is perfectly fine if the dev doesn't include Facebook/Twitter
// support
}
try {
TwitterProvider.signOut(context);
} catch (NoClassDefFoundError e) {
// See comment above
// Note: we need to have separate try/catch statements since devs can include
// _either_ one of the providers. If one crashes, we still need to sign out of
// the other one.
}
return GoogleSignIn.getClient(context, GoogleSignInOptions.DEFAULT_SIGN_IN).signOut();
} So this is almost definitely coming from the The good news is that you can safely ignore this error., although it's definitely a pain to detect so we should fix it. I have some ideas for how we can work around it in FirebaseUI but I'm also going to raise this with the SmartLock folks. |
@ifeins I bet this comes from disabling SmartLock at the account level on your device, did you see this error before you did that? Edit: yep that's the trick, I was able to reproduce. |
@ifeins fix implemented, will be included in |
@samtstern Thanks for the quick turnaround 👍 This issue happened both when SmartLock was enabled and disabled on the device. |
This has been fixed and released in version |
@samtstern Thanks for the fix, I had this issue in a side project which I didn't touch for a very long time, so took me a while to verify this. But it's working great now :) |
@ifeins thanks for verifying! |
Hey guys, W/SmartLockViewModel: Non-resolvable exception: com.google.android.gms.common.api.ApiException: 16: No eligible accounts can be found. E/AuthUI: A sign-in error occurred. Is this still the same issue as above? |
Hi, I get the same error as @aidanmack with version 4.2.0. Any news on that? Thanks! |
@ewaldbenes can you tell me the steps you're using to reproduce? |
API Level: 28 As the dependencies I use: implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.0' User already exists inside Firebase. I've got an invisible activity that is my entry point and checks if the user is already signed in. If the user is not then I start the auth flow. EntryActivity:
override fun onCreate(savedInstanceState: Bundle?) {
...
val auth = FirebaseAuth.getInstance()
if (auth.currentUser != null) {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
} else {
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.build(), RC_SIGN_IN)
}
}
override fun onPause() {
super.onPause()
finish() // finish() call needed for invisible activities
} The user gets signed in but the app closes before the result arrives in the This error shows up in Logcat:
I've found this thread here and tried to unset
Then I suspected that the invisibility together with
Using Pretty interesting that nobody else has fallen across this so far. Hopefully this descriptions helps. Anyway thanks for your help! |
Same problem here |
Did this ever get resolved? Having the same issue on api level 28 emulator with similar code. |
Step 1: Describe your environment
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:
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:
This is the code I'm using to perform sign in (notice that I disable smart lock):
I've also attempted to disable SmartLock on the device itself but the exception is still being thrown.
The text was updated successfully, but these errors were encountered: