尝试从 Firestore 获取文档时,如果设备通过 Wifi 连接,则连接失败并显示以下错误消息:
\nW/Firestore( 4903): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn\'t respond within 10 seconds\nW/Firestore( 4903): 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.\nRun Code Online (Sandbox Code Playgroud)\n重现
\n通常,在物理设备中运行时会发生错误。\n我创建了一个小应用程序,以便能够在对其余代码的干扰最小的情况下重现错误。请参阅下面的代码。
\n当您在调试器上点击运行(我正在使用 VSCode),然后单击 (+) 按钮向 Firestore 发出请求时,它会尝试几秒钟(您将看到进度指示器,没有测试应用程序),然后调用snapshot = await docRef.get()失败并显示以下错误消息:
PlatformException(Error performing get, Failed to get document …Run Code Online (Sandbox Code Playgroud)