使用createUserWithEmailAndPassword或signInWithEmailAndPassword时,我继续收到错误消息。两次抛出"发生了内部错误。 [错误请求]"错误,我无法弄清楚原因。 Google API和Firebase API之间的所有API和SHA1密钥都匹配,我启用了电子邮件/密码身份验证。这是我的代码片段,但我无法弄清楚为什么会这样。
public void signIn(String email,String password){
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
//On successful sign in...
//Take the user to MainActivity
Intent intent = new Intent(getContext(), MainActivity.class);
startActivityForResult(intent, 1);
dialogFragment.dismissAllowingStateLoss();
} else {
//If user can't sign in, Toast, hide progress bar, un-dim background, and make screen touchable again
Toast.makeText(getContext(), "Invalid username or password", Toast.LENGTH_SHORT).show();
dialogFragment.dismissAllowingStateLoss();
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
}
}
});
}