On a device where the user has no Google account yet the user cannot sign in via email address already associated with a Google account.
Fail with "An error has occurred." Toast and the following message in LogCat:
E/GoogleProvider: Error logging in with Google. 5 null
Start the GMS error resolution (Google system login flow) as does directly using the "Sign in with Google" button and actually get into the "Checking credentials" and "Add your account" screens.
@consp1racy I was able to reproduce this, thanks for pointing it out. Will try to get a fix in soon.
Ok I figured out where this occurs. When AuthMethodPickerActivity creates GoogleProvider it does so with email = null. When WelcomeBackIdpPrompt does this it sets email equal to the email entered from the email linking flow.
It seems that the Google Sign In API does not launch the add-account-to-device flow when setAccountName is called on the GoogleApiClient.
I will bring this up with the Google Sign In team to see what the recommended path forward is.
@consp1racy I have brought this up with the Sign In team and, for now, there's nothing FBUI can do. There is no way for us to launch the "add account" flow with a specific email in mind. That's why right now we return this error, as there's no way for us to trigger the proper google sign in flow and guarantee it's for the right account.
Hopefully the case of "user signs in with Google on device A and then attempts to sign in with email on device B where the google account is not present" is a very small edge case (I believe it is).
So as far as FBUI is concerned, this is working as intended and I will close the issue. I will log a feature request with the Android accounts team to see if we can enable this case.
Understood, here's a counter proposal: If such error should occur, do as if the "Sign in with Google" was pressed. That should at least point the user in the general direction instead of failing without an obvious way out. What do you think?
@consp1racy that's probably a good idea. I will have to see if we can unambiguously differentiate this error code from others and trigger that fallback. I will re-open and investigate some more.
The fix for this issue has been released in version 1.2.0.