'Getting error - Cannot resolve method 'getInstance' in 'FirebaseAuthException'

Getting error when trying to fAuth = FirebaseAuthException.getInstance();

public class Register extends AppCompatActivity {
    FirebaseAuthException fAuth;
    FirebaseDatabase db;
    DatabaseReference users;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);


        fAuth = FirebaseAuthException.getInstance();
    }
}






Solution 1:[1]

It looks like you should be using FirebaseAuth instead of FirebaseAuthException. Use FirebaseAuth.getInstance() to obtain a reference to the FirebaseAuth object to then make subsequent calls like createUserWithEmailAndPassword() on.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dan Harms