FirebaseAuthUserCollisionException

public final class FirebaseAuthUserCollisionException extends FirebaseAuthException


Thrown when an operation on a FirebaseUser instance couldn't be completed due to a conflict with another existing user.

This could happen in the following cases:

  • ERROR_EMAIL_ALREADY_IN_USE when trying to create a new account with createUserWithEmailAndPassword or to change a user's email address, if the email is already in use by a different account
  • ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL when calling signInWithCredential with a credential that asserts an email address in use by another account. This error will only be thrown if the "One account per email address" setting is enabled in the Firebase console (recommended).
  • ERROR_CREDENTIAL_ALREADY_IN_USE when trying to link a user with an corresponding to another account already in use.
Inspect the error code and message to find out the specific cause.

Resolve this exception by asking the user to sign in again with valid credentials. In the case that this is thrown when using a PhoneAuthCredential, you can retrieve an updated credential from getUpdatedCredential and use it to sign-in.

Summary

Public fields

@Nullable String

Public methods

@Nullable String

Returns the email used when an error occurred when trying to sign in or link with an which was already associated with an account.

@Nullable AuthCredential

Returns a new valid AuthCredential if this error occurred when trying to sign in or link with an AuthCredential which was already associated with an account.

Inherited methods

From com.google.firebase.auth.FirebaseAuthException
@NonNull String

Returns an error code that may provide more information about the error.

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] p)
String

Public fields

email

public @Nullable String email

Public methods

getEmail

public @Nullable String getEmail()

Returns the email used when an error occurred when trying to sign in or link with an which was already associated with an account. Otherwise, returns null.

getUpdatedCredential

public @Nullable AuthCredential getUpdatedCredential()

Returns a new valid AuthCredential if this error occurred when trying to sign in or link with an AuthCredential which was already associated with an account. Otherwise, returns null.