繁体   English   中英

Firestore 无法访问 Cloud Firestore 后端。 使用 react-native run-android 命令启动 React Native 应用程序时出错

[英]Firestore could not reach Cloud Firestore backend. Error when starting React Native application with react-native run-android command

我在我的应用程序中使用 firebase。 我一直使用 expo 启动命令,我可以在我使用的移动模拟器上尝试 expo 应用程序上的应用程序。 我决定生成它的 apk,但看起来我做不到。 运行 react-native run-android 命令后,我可以看到登录和注册屏幕,但是当我想按下调用与 firebase 相关的 function 的按钮时,应用程序显示此错误,

在此处输入图像描述

正如我所提到的,我可以使用该应用程序的所有功能,与 firebase 相关的功能运行良好。 我如何在模拟器上安装应用程序并在使用 expo 启动时使用它?

您的问题可能来自您的 Firestore,您可以更改 Firestore 中的规则。 步骤:

  1. 打开你的 Firestore 控制台

  2. select 您的项目

  3. 移动到firestore数据库并单击规则

  4. 试着像这样改变

    规则版本='2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { 允许读,写:如果为假; } } }

希望能解决你的问题:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM