相关疑难解决方法(0)

com.google.firebase.firestore.FirebaseFirestoreException:由于客户端处于脱机状态,因此无法获取文档.Android的

我得到这个运行时错误,我不明白它背后的原因.

com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.

下面是我的Activity中的代码,它试图从云Firestore中获取数据

DocumentReference docRef = db.collection("room-id-1").document("participan-name-1");
    docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
        @Override
        public void onComplete(@NonNull Task<DocumentSnapshot> task) {
            if (task.isSuccessful()) {
                DocumentSnapshot document = task.getResult();
                if (document != null) {
                    Log.d(TAG, "DocumentSnapshot data: " + task.getResult().getData());
                    userData.registerUserToHotspot(roomId_str, participantName_str);
                } else {
                    Log.d(TAG, "No such document");
                }
            } else {
                Log.d(TAG, "get failed with ", task.getException());
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

我可以做些什么吗?

android firebase google-cloud-firestore

18
推荐指数
1
解决办法
2801
查看次数

Firebase Cloud Firestore抛出“客户端脱机”

在加载页面的4次中,大约有3次是从Firestore客户端SDK(Web)收到此错误的。这极大地减缓了开发速度。身份验证,实时数据库和存储都可以正常工作。

Failed to get document because the client is offline.
Run Code Online (Sandbox Code Playgroud)

错误

有什么我可以做的吗?

firebase google-cloud-firestore

5
推荐指数
3
解决办法
4642
查看次数

标签 统计

firebase ×2

google-cloud-firestore ×2

android ×1