last day (15 days later) » 

11:17 AM
0
Q: Firebase Authentication createUserWithEmailAndPassword not working in Android

Dawn17I am trying to implement an authentication page in my application. I enabled email authentication in my firebase database and coded as follows public class AdminLoginActivity extends AppCompatActivity { private Button loginButton; private EditText inputEmail; private EditText inputP...

 
please provide error log. Without error log it is not possible to solve your error.
 
@AmrishKakadiya My app is not actually crashing but getting the message as shown in my EDIT
 
password length must be morethan 6 in firebase auth. try with that.
 
@AmrishKakadiya Yeah. I tried but didnt work
 
Then please post gradle ,manifest may be that help us to reach error
and please attach screenshot of activity_admin_login ui
 
11:17 AM
attached! thanks
 
and where is manifest?
 
Hello
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ykim164cs242.tournamentor">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/TournamentorTheme">
<activity android:name=".Activity.Common.MainActivity"></activity>
 
everything is perfect. clean project, rebuild project, invalidate cache and restart studio. may this will helps you. and make sure you are pressing loginButton not loginText . because click event is on loginButton .
 
do you think there could be a problem in my firebase?
 
nop. i think you have to try to create new firebase project and use Firebase assistant from android studio. it will automatically setup your project.
 
11:27 AM
when i debug it
    firebaseAuth.createUserWithEmailAndPassword(email, password)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    //checking if success
                    if(task.isSuccessful()){
                        //display some message here
                        Toast.makeText(AdminLoginActivity.this,"Successfully registered",Toast.LENGTH_LONG).show();
                    }else{
it stops on the .addOnCompleteListener this part
email and password passes properly into the createUserWithEmailAndPassword function
 
please remove " progressDialog.dismiss();"
its commented in your question post
 
that wont make a difference becuase it doesnt even go inside
 
its listener, it works on different thread, and progressDialog will throw null pointer exception
 
so the onComplete is not working
 
you want to create new user or want to loging of existing user?
 
11:33 AM
create new
i changed the firebase version to 9.6.0 and it worked
it's weird lol
thansk for your help though
 

last day (15 days later) »