hi my android studio app keeps crashing when im sending data to firebase, the logcat gives me this error:
java.lang.RuntimeException: Found conflicting getters for name getText on class androidx.appcompat.widget.AppCompatEditText at com.google.firebase.firestore.util.CustomClassMapper$BeanMapper.(CustomClassMapper.java:629) at com.google.firebase.firestore.util.CustomClassMapper.loadOrCreateBeanMapperForClass(CustomClassMapper.java:377) at com.google.firebase.firestore.util.CustomClassMapper.serialize(CustomClassMapper.java:177) at com.google.firebase.firestore.util.CustomClassMapper.serialize(CustomClassMapper.java:140) at com.google.firebase.firestore.util.CustomClassMapper.serialize(CustomClassMapper.java:104) at com.google.firebase.firestore.util.CustomClassMapper.convertToPlainJavaTypes(CustomClassMapper.java:78) at com.google.firebase.firestore.UserDataReader.convertAndParseDocumentData(UserDataReader.java:231) at com.google.firebase.firestore.UserDataReader.parseSetData(UserDataReader.java:75) at com.google.firebase.firestore.DocumentReference.set(DocumentReference.java:167) at com.google.firebase.firestore.DocumentReference.set(DocumentReference.java:147) at com.example.finalproject3.RegisterScreen$1$1.onComplete(RegisterScreen.java:82) at com.google.android.gms.tasks.zzj.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 2021
CodePudding user response:
It looks you're trying to send an EditText
control to the database. Since Firebase only supports JSON types and an EditText
is not a JSON type, you get an error message that says that.
You probably want to send the value that the user entered into the EditText
to the database, so have a look at: Get Value of a Edit Text field