I am trying to add documents to Firebase Firestore from my android app. This is the code that I currently have.
FirebaseFirestore db = FirebaseFirestore.getInstance();
Map<String, Object> newuser = new HashMap<>();
newuser.put("Username",username);
newuser.put("Password",password);
newuser.put("Nickname",userNickname);
newuser.put("Code", "ffff");
newuser.put( "Othercode", "ffffffff");
newuser.put("Age", "0");
//Point 1
db.collection("Users").document(username).set(newuser)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
//Point 2
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
//Point 3
}
});
//Point 4
When I run this code it will reach Point 1 and Point 4, but never Point 3 or Point 2. I'm pretty new to android and java so I'm not sure what the things in the Logcat mean either:
2020-09-05 09:53:53.514 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:53:55.391 19216-19242/com.example.app W/e.librarysearc: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
2020-09-05 09:54:27.236 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:27.260 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:33.134 19216-19216/com.example.app W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@12d6200
2020-09-05 09:54:33.417 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:35.895 19216-19328/com.example.app W/ManagedChannelImpl: [{0}] Failed to resolve name. status={1}
2020-09-05 09:54:36.271 19216-19216/com.example.app W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@549ad31
2020-09-05 09:54:36.572 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:36.814 19216-19328/com.example.app W/ManagedChannelImpl: [{0}] Failed to resolve name. status={1}
2020-09-05 09:54:42.040 19216-19216/com.example.app I/AssistStructure: Flattened final assist data: 3832 bytes, containing 1 windows, 12 views
2020-09-05 09:54:43.993 19216-19216/com.example.app I/AssistStructure: Flattened final assist data: 3832 bytes, containing 1 windows, 12 views
2020-09-05 09:54:45.386 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:45.408 19216-19245/com.example.app I/chatty: uid=10091(com.example.librarysearch) RenderThread identical 1 line
2020-09-05 09:54:45.437 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:51.060 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
2020-09-05 09:54:51.079 19216-19245/com.example.app D/EGL_emulation: eglMakeCurrent: 0xe9c85300: ver 3 0 (tinfo 0xe9c83650)
It was functioning, but suddenly it stopped working, so I'm not sure what I did. If you need any more code, I can provide it as well. Thank you in advance!