Repository navigation
Description
Step 1: Are you in the right place?
- Yes: this is a bug in FirebaseUI Auth's code in this repository.
Step 2: Describe your environment
- Android device: Samsung Galaxy A06
- Android OS version: 16
- Google Play Services version: not recorded
- Firebase/Play Services SDK version: Firebase BoM 34.19.0 (firebase-auth 24.2.0)
- FirebaseUI version: 10.0.0
We reproduced this on one device, but the cause is in FirebaseUI's navigation (below), so it isn't device- or OEM-specific.
The Firebase project has "Link accounts that use the same email" turned on, and the app configures Google and Facebook (plus Apple and Phone) but no AuthProvider.Email.
Step 3: Describe the problem:
Steps to reproduce:
- Sign in with Google, which creates a user with email X.
- Sign out.
- Sign in with Facebook, using a Facebook account whose email is also X.
- FirebaseUI shows "An account already exists with the email X. Please sign in with your existing account to link your Facebook account." Tap "Sign in".
Observed Results:
- The app crashes:
java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:222)
at com.firebase.ui.auth.ui.screens.email.EmailAuthScreenKt.EmailAuthScreen(EmailAuthScreen.kt:212)
at com.firebase.ui.auth.ui.screens.email.EmailAuthDestinationsKt.EmailAuthStep(EmailAuthDestinations.kt:148)
at com.firebase.ui.auth.ui.screens.email.EmailAuthDestinationsKt.emailAuthDestinations$lambda$6(EmailAuthDestinations.kt:81)
For AccountLinkingRequiredException, the error dialog's recover action always calls navigateToEmailStep(AuthRoute.Email.SignIn(), exception.email) (FirebaseAuthScreen.kt, around line 930), whichever provider owns the existing account. EmailAuthScreen then calls .first() on the configured Email providers, which throws when there are none. Even with an Email provider configured, an account created with Google has no password, so that screen can't complete the link.
Google and Apple don't reach this, since Firebase links them to an existing account automatically. Facebook does, because its email isn't treated as verified.
The dialog's message is also hard-coded in English in signInAndLinkWithCredential (EmailAuthProvider+FirebaseAuthUI.kt). ErrorRecoveryDialog shows error.message when it's set, so the translated accountLinkingRequiredRecoveryMessage is never used, similar to #2506.
Expected Results:
- The dialog offers to sign in with the provider that owns the account and then links the pending Facebook credential, as 8.x did with
WelcomeBackIdpPrompt. When that provider can't be determined, it shouldn't offer an action that opens an Email screen the app doesn't configure.
Relevant Code:
FirebaseAuthScreen(
configuration = authUIConfiguration {
context = applicationContext
providers {
provider(AuthProvider.Google(scopes = emptyList(), serverClientId = null))
provider(AuthProvider.Facebook())
}
},
onSignInSuccess = { },
onSignInFailure = { },
onSignInCancelled = { },
)
Activity
Mastersam07 commentedon Nov 4, 2026
Hi @pmarino, thanks for the detailed report. I've confirmed this on
master. The account-linking recovery always routes to the Email sign-in step regardless of which provider owns the existing account, and the dialog message isn't localized (same pattern as #2506). I'll look into a fix and keep this issue updated.