0

I'm creating an apps for my final year project. So i want to use login and signup features. But when i enter the details of the signup, its keep fail and do not direct the data to the firebase.

    Signup.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (validate()){
                String Email = email.getText().toString().trim();
                String Password = password.getText().toString().trim();

                firebase.createUserWithEmailAndPassword(Email, Password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                            if (task.isSuccessful()){
                            Toast.makeText(Signup.this, "Signup successful", Toast.LENGTH_SHORT).show();
                            startActivity(new Intent(Signup.this, LoginPage.class));
                        }
                        else
                        {
                            Toast.makeText(Signup.this, "Signup failed", Toast.LENGTH_SHORT).show();
                        }
                    }
                });
            }
        }
    });

So, is there anything that i have to change?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Aech
  • 63
  • 8
  • what does the logcat say? – Suri Oct 22 '19 at 00:58
  • **W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.** The logcat said this – Aech Oct 22 '19 at 07:45
  • Thank you! Im really sorry. I didnt saw that. Again, im sorry. Plus, im new here. So i need an exposure about this. – Aech Oct 22 '19 at 11:19

2 Answers2

1

make sure to initialize the FirebaseAuth object

FirebaseAuth firebase = FirebaseAuth.getInstance();

and Enable the email method in Firebase console

Youssef Islem
  • 34
  • 2
  • 6
  • I already initialize both of firebaseauth object and enable the email method in firebase console – Aech Oct 22 '19 at 07:12
0

Make sure that you enabled email as an authentication method on firebase portal authentication section.

pseudozach
  • 398
  • 6
  • 14