I do not see any type of error when I click to register the button, I have already put all types of password sizes and I have put up my own valid email only that does not register in firebase authentication.
private void Cadastrar() {
nome = (EditText) findViewById(R.id.edit_cadastro_nome);
email = (EditText) findViewById(R.id.edit_cadastro_email);
senha = (EditText) findViewById(R.id.edit_cadastro_senha);
botaoCadastar = (Button) findViewById(R.id.bt_cadastrar);
botaoCadastar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
usuario = new Usuario();
usuario.setNome(nome.getText().toString());
usuario.setEmail(email.getText().toString());
usuario.setSenha(senha.getText().toString());
cadastarUsuario();
}
});
}
private void cadastarUsuario(){
autenticacao = ConfiguracaoFireBase.getFirebaseAutenticacao();
autenticacao.createUserWithEmailAndPassword(
usuario.getEmail(),
usuario.getSenha()
).addOnCompleteListener(CadastroUsuarioActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Toast.makeText(CadastroUsuarioActivity.this,"Sucesso ao cadastrar", Toast.LENGTH_LONG).show();
Log.i(usuario.getEmail(), "Erro");
}else{
Toast.makeText(CadastroUsuarioActivity.this,"Erro ao cadastrar", Toast.LENGTH_LONG).show();
}
}
});
}
FIREBASE CONFIGURATION
public final class ConfiguracaoFireBase {
private static DatabaseReference referenciaFirebase;
private static FirebaseAuth autenticacao;
public static DatabaseReference getFirebase() {
if (referenciaFirebase == null) {
referenciaFirebase = FirebaseDatabase.getInstance().getReference();
}
return referenciaFirebase;
}
public static FirebaseAuth getFirebaseAutenticacao(){
if(autenticacao == null){
autenticacao = FirebaseAuth.getInstance();
}
return autenticacao;
}
}