【问题标题】:Android Firestore "Could not reach Cloud Firestore backend" error on LTE (fine with WIFI)LTE 上的 Android Firestore“无法到达 Cloud Firestore 后端”错误(WIFI 良好)
【发布时间】:2021-10-26 05:07:10
【问题描述】:

从昨天 (2021.10.25) 开始,我的应用在连接到 LTE 时就没有连接到 Firebase。 我已经在使用多个不同电话网络提供商的多台设备上进行了尝试。

更具体地说,在下面的代码中,我们转到“Log task unsuccessful”的情况。

        FirebaseFirestore db = FirebaseFirestore.getInstance();
        DocumentReference docRef = db.collection("Version").document("MinVersion");
        docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
            @Override
            public void onComplete(@NonNull Task<DocumentSnapshot> task) {
                if (task.isSuccessful()) {
                    DocumentSnapshot document = task.getResult();
                    if (document.exists()) {
                      //Do stuff here
                    }
                } else {
                    //Log task unsuccessful
                }
            }
        });

当我打开 wifi 时,firebase 会立即连接。

可能有用的日志:

W/Firestore: (23.0.4) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
    
    This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

(但是,互联网连接良好 - 一旦应用程序加载,广告工作正常,网络浏览器工作正常等 - 只有 firestore 不工作)

这可能是什么原因造成的?我住在韩国,昨天我们最大的服务提供商之一发生了 40 分钟的服务中断……这可能与什么有关吗?也许消防队临时将韩国列入黑名单进行维修?任何帮助将不胜感激...

【问题讨论】:

  • 首先,停止忽略错误。在 else 部分添加Log.d(TAG, task.getException().getMessage());。您是否在 logcat 中打印了一些内容?
  • @AlexMamo 这是错误:“com.google.firebase.firestore.FirebaseFirestoreException: 无法获取文档,因为客户端离线。”
  • 所以很可能您的互联网连接不正常,对吧?
  • @AlexMamo 就是这样。互联网速度很好,这影响了所有使用 LTE 的用户,而不仅仅是我。因此,互联网连接不是问题。

标签: android firebase google-cloud-firestore


【解决方案1】:

只是为了更新可能在这里偶然发现的人,截至 2021 年 10 月 27 日(问题首次发生后 2 天),问题已自行解决。即使在 LTE 上,所有用户都可以使用 firestore(应该如此)。

应用根本没有更新。

我假设韩国移动服务提供商已更新防火墙以再次允许 Firestore 服务...

【讨论】:

    猜你喜欢
    • 2021-11-05
    • 2020-09-29
    • 2018-09-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-28
    • 2021-09-10
    • 2018-09-15
    • 2018-04-18
    相关资源
    最近更新 更多