I think the error is coming from here but I don't know what is my problem
//validate the fields
let error = validateField()
if error != nil{
// there is something wrong with the fields, show error message
showError(error!)
}
else{
//create celaned versions of the data
let first_name = firstNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let last_name = lastNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let email = emailTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let password = passwordTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
//create users
Auth.auth().createUser(withEmail: email, password: password) { (result, err) in
//check for errors
if err != nil {
//there was an error creating users
self.showError("Error creating user")
}
else{
//user create successfully, now store f and l name
let db = Firestore.firestore()
db.collection("users").addDocument(data: ["first_name":first_name, "last_name":last_name, "uid": result!.user.uid]) {(error) in
if error != nil {
//show error message
self.showError("User name couldn't be save in database")
}
}
//transition to home screen
self.transtionToHome()
}
}
}
}
**and here is the error message:
```libsystem_kernel.dylib`__pthread_kill:**
0x7fff70173004 <+0>: movl $0x2000148, %eax ; imm = 0x2000148
0x7fff70173009 <+5>: movq %rcx, %r10
0x7fff7017300c <+8>: syscall
-> 0x7fff7017300e <+10>: jae 0x7fff70173018 ; <+20> Thread 14: "-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x6000005ad8f0"
0x7fff70173010 <+12>: movq %rax, %rdi
0x7fff70173013 <+15>: jmp 0x7fff7016d1c5 ; cerror_nocancel
0x7fff70173018 <+20>: retq
0x7fff70173019 <+21>: nop
0x7fff7017301a <+22>: nop
0x7fff7017301b <+23>: nop
4
0
934