도저히 무슨 문제가 있는지 모르겠어요..
회원가입을 하는 페이지 입니다. btnSignUpFinish버튼을 누르면 회원가입이 되야 하는데 회원가입 실패라고 나옵니다. 왜 그런거죠...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);
edtSignEmail = findViewById(R.id.edtSignEmail);
edtSignPwd = findViewById(R.id.edtSignPwd);
edtSignName = findViewById(R.id.edtSignName);
btnSignUpFinish = findViewById(R.id.btnSignUpFinish);
mFirebaseAuth = FirebaseAuth.getInstance();
btnSignUpFinish.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
createUser(edtSignEmail.getText().toString().trim(),edtSignPwd.getText().toString().trim());
}
});
}
private void createUser(String email, String password) {
mFirebaseAuth.createUserWithEmailAndPassword(email,password)
.addOnCompleteListener(SignUp.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Toast.makeText(SignUp.this, "회원가입 성공", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(SignUp.this, "회원가입 실패", Toast.LENGTH_SHORT).show();
}
}
});
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-auth:21.0.2'
implementation platform('com.google.firebase:firebase-bom:29.1.0')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}