firebase createUserWithEmailAndPassword is not working in android

后端 未结 8 513
别跟我提以往
别跟我提以往 2021-01-14 15:09

I\'m trying to use the createUserWithEmailAndPassword method to create users but not able to do so. The OnAuthenticate method is being called but user object is

相关标签:
8条回答
  • 2021-01-14 15:19

    I spent 2 days searching for this solution, only to find out it is because of the emulator. Try to use a smartphone to run your app. For me it worked.

    0 讨论(0)
  • 2021-01-14 15:19

    I think the problem is that you might not have added the firebase SDKs in your App.

    Add the following implementation inside the dependencies in your module(app-level) Gradle file(app/build.gradle):

    dependencies {
           implementation 'com.google.firebase:firebase-auth:19.3.1'
    }
    
    0 讨论(0)
  • 2021-01-14 15:23

    I have the same problem.

    change:

    mAuth.createUserWithEmailAndPassword("9199999989@pintech.com", "corrfecthorsebatterystaple")
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>()
    

    to:

    mAuth.createUserWithEmailAndPassword("9199999989@pintech.com", "corrfecthorsebatterystaple")
                .addOnCompleteListener(MainActivity.this, new OnCompleteListener<AuthResult>()
    
    0 讨论(0)
  • 2021-01-14 15:26

    I had this problem too. The password I was testing the app with was just too short. I extended it to a longer password and it worked. You have to meet google's password complexity standards.

    0 讨论(0)
  • 2021-01-14 15:29

    For me, the way I solved this issue was firstly to make sure that I had enabled Email/Password signInAuth in firebase

    lastly I made sure that the line

    mAuth.createUserWithEmailAndPassword(username,password)
                    .addOnCompleteListener(**SignUpActivity.this**, task -> { 
    

    ... }) had myactivity.this instead of this alone as the context

    0 讨论(0)
  • 2021-01-14 15:43

    Just for anyone still looking something that hasn't worked above:

    I found that using your activity name before the this keyword in the first parameter of the .addOnCompleteListener works for me.

    eg. .addOnCompleteListener(LoginActivity.this, etc..);

    Hope this helps anyone still looking, Adam

    0 讨论(0)
提交回复
热议问题