
Error en firebaseAuth.createUserWithEmailAndPassword
Publicado por Santiago (2 intervenciones) el 15/11/2022 15:49:42
Buenos dias! estoy iniciando mis primeras lineas en programacion kotlin e intentando hacer un login via firebase (en el momento de registrar el usuario) la aplicacion "da un error que no puedo caputar" y responde con un popup "unfortunaly, "yourAPP" has stopped"
firebase esta sincronizado con la app y falla puntualmente al momento de llamar al registro, el correo no esta utilizado y no se por donde mirar. intente depurar la app pero al momento de hacer el registro, se haltea y no muestra mensaje
firebase esta sincronizado con la app y falla puntualmente al momento de llamar al registro, el correo no esta utilizado y no se por donde mirar. intente depurar la app pero al momento de hacer el registro, se haltea y no muestra mensaje
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import androidx.appcompat.content.res.AppCompatResources
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
class RegisterFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
private lateinit var email: EditText
private lateinit var password: EditText
private lateinit var confirmPassword: EditText
private lateinit var firebaseAuth: FirebaseAuth
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_register, container, false)
email = view.findViewById(R.id.reg_Email)
password= view.findViewById(R.id.reg_password)
confirmPassword = view.findViewById(R.id.reg_confirm_password)
firebaseAuth = Firebase.auth
view.findViewById<Button>(R.id.LoginButton_reg).setOnClickListener {
val navRegister = activity as FragmentNavigation
navRegister.navigateFrag(LoginFragment(),false)
}
view.findViewById<Button>(R.id.RegisterButton_reg).setOnClickListener {
if (validateData()) {
try {
firebaseAuth.createUserWithEmailAndPassword(
email.text.toString(),password.text.toString()
)
.addOnCompleteListener { task -> //ERROR ACA!!!
if (task.isComplete) {
Toast.makeText(
context,
"Registrado Correctamente",
Toast.LENGTH_SHORT
).show()
} else {
Toast.makeText(context, task.exception?.message, Toast.LENGTH_SHORT)
.show()
}
}
}
catch (e : Exception) {
Toast.makeText(context, e.message, Toast.LENGTH_SHORT)
.show()
}
}
}
return view
}
Valora esta pregunta


0