Firebase - Why it does not execute addOnCompleteListener code

Asked

Viewed 115 times

0

How does addOnCompleteListener work, it is not a System that will be called when the signInWithEmailAndPassowrd operation is executed? It enters a correct login and password and click on the button it reaches the task.addOnCompleteListener but does not enter the onComplete method.

Task<AuthResult> task = mFirebaseAuth.signInWithEmailAndPassword(user.getEmail(), user.getPassword());



                task.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        Task<AuthResult> taskUser = task;
                        Log.i("app", "Sucesso - " + taskUser.isSuccessful());
                        if (taskUser.isSuccessful()) {
                            booSucessLogin = true;
                            mFirebaseInteractionLogin.sucessSiginUp(user);
                        }else{
                            booSucessLogin = false;
                            Log.i("app", "Falha - " + taskUser.getException().toString());

                            mFirebaseInteractionLogin.errorSiginUp("The email address is badly formatted", taskUser.getException());
                        }

                    }
                });

1 answer

1

Weird, I tested it on another device and it worked.

I’ve seen some reports of the same problem and it may also be the implementation 'com.google.android.gms:play-services-auth:X.x.x outdated in the project.

Or it could be google play outdated in the app!!!

  • Exactly. Old versions of Firebase Auth or Google Play Services start to show problems if they are not updated.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.