1

When I am trying to sign up a user using Firebase authentication method in my Android application, this is happening:

1

It's not registering a user This is the Registration code

final String _name = txtName.getText().toString().trim();
String _email = txtEmail.getText().toString().trim();
String _pass = txtPass.getText().toString().trim();

if(!TextUtils.isEmpty(_name) && !TextUtils.isEmpty(_email) && !TextUtils.isEmpty(_pass) ) {

    mProgress.setMessage("Registrando ...");
    mProgress.show();

    firAuth.createUserWithEmailAndPassword(_email, _pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
        @Override
        public void onComplete(@NonNull Task<AuthResult> task) {

            if(task.isSuccessful()) {

               //the user has been registered

            }
        }
    });
AL.
  • 36,815
  • 10
  • 142
  • 281

1 Answers1

0

You are registring the user but not hiding the progress bar after user successfully registered in the firebase. Try applying this code and check the firebase dashboard for authentication. And also Implement onFailureListener to know the reason why user is not being registered.

    firAuth.createUserWithEmailAndPassword(_email, _pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                     mProgress.dismis();
                    if(task.isSuccessful()) {

                       //the user has been registered
                       Log.d("onSuccess","USER REGISTERED");
                    }
                }
            }).addOnFailureListener(new OnFailureListener() {
               @Override
               public void onFailure(@NonNull Exception e) {
                    mProgress.dismis();
                    Log.e("onFailure",e.getMessage());
                }
               }
             );

EDIT: If you are still facing the same issue go and check these settings in your firebase console authentication tab ,

Select SIGN-IN METHOD and Check the status of Email/Password if it is Disable then switch it to the Enable.

And it looks like you are using Genymotion, so have you installed the Google Libraries into your virtual device ?

If not follow this thread or test your app on a physical device

Community
  • 1
  • 1
Darshan Soni
  • 1,779
  • 1
  • 12
  • 24