I'm testing out the firestore setting up tutorial, but I'm hitting this wall that I just don't seems to find any solution to it. can anyone help?
I'm just following the basic setting up code, but am unable to add data to Firestore. I've already succeeded in testing realtime database and so now I'm testing the firestore.
this is the code in my main activity
FirebaseFirestore db = FirebaseFirestore.getInstance();
Map<String, Object> user = new HashMap<>();
user.put("first", "Ada");
user.put("last", "Lovelace");
user.put("born", 1815);
db.collection("cities").document("LA")
.set(user)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "DocumentSnapshot successfully written!");
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Error writing document", e);
}
});
and this is the error
04-23 01:32:05.450 3260-3320/com.lepuff.hendry.postest W/Firestore: (18.2.0) [Firestore]: Failed to update ssl context
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest W/dalvikvm: Unable to resolve superclass of Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor$DefaultNetworkCallback; (399)
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest W/dalvikvm: Link of class 'Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor$DefaultNetworkCallback;' failed
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest E/dalvikvm: Could not find class 'com.google.firebase.firestore.remote.AndroidConnectivityMonitor$DefaultNetworkCallback', referenced from method com.google.firebase.firestore.remote.AndroidConnectivityMonitor.configureNetworkMonitoring
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest W/dalvikvm: VFY: unable to resolve new-instance 6784 (Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor$DefaultNetworkCallback;) in Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor;
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest W/dalvikvm: Unable to resolve superclass of Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor$DefaultNetworkCallback; (399)
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest W/dalvikvm: Link of class 'Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor$DefaultNetworkCallback;' failed
04-23 01:32:05.710 3260-3320/com.lepuff.hendry.postest D/dalvikvm: DexOpt: unable to opt direct call 0xe049 at 0x0d in Lcom/google/firebase/firestore/remote/AndroidConnectivityMonitor;.configureNetworkMonitoring
this is the rule
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}}}
already added the dependency, apply plugin, and classpath.
thanks and regards for any help.