Firebase Email and Password Authentication with android - User sign up

拥有回忆 提交于 2019-12-06 15:15:23

After speaking with OP, the error was:

I/error is: An internal error has occurred. [ Access Not Configured. Google Identity Toolkit API has not been used in project 248549959996 before or it is disabled. Enable it by visiting console.developers.google.com/… then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. ]

To solve it he had to enable the google identity toolkit api.

Also it is better to add the below to be able to know what exactly the problem is:

Add this in your else, you will get the error more clearer:

Toast.makeText(RegisterPage.this, "User Authentication Failed: " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();

or add it in Log:

Log.i("error is :", task.getException().getMessage());

You can avoid exception like below :-

    if (ex instanceof FirebaseAuthException) {
        FirebaseAuthError error = FirebaseAuthError.fromException((FirebaseAuthException) ex);
        // TODO
    } else {
        // TODO
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!