Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native Expo不适用于firebase emulator_React Native_Google Cloud Firestore_Expo_Firebase Tools - Fatal编程技术网

React native Expo不适用于firebase emulator

React native Expo不适用于firebase emulator,react-native,google-cloud-firestore,expo,firebase-tools,React Native,Google Cloud Firestore,Expo,Firebase Tools,我正在尝试通过我的Expo应用程序在物理设备和模拟设备上访问firestore emulator(本地托管),这两种设备都不工作。当我调用模拟的firestore数据库(例如设置文档)时,它不会显示在UI上。但是,如果我为真正的firestore运行完全相同的代码,它将正常工作 我的firebase.json配置是: { “firestore”:{ “规则”:“firestore.rules”, “索引”:“firestore.indexes.json” }, “仿真器”:{ “firesto

我正在尝试通过我的Expo应用程序在物理设备和模拟设备上访问firestore emulator(本地托管),这两种设备都不工作。当我调用模拟的firestore数据库(例如设置文档)时,它不会显示在UI上。但是,如果我为真正的firestore运行完全相同的代码,它将正常工作

我的firebase.json配置是:

{
“firestore”:{
“规则”:“firestore.rules”,
“索引”:“firestore.indexes.json”
},
“仿真器”:{
“firestore”:{
“端口”:8080
},
}

}
您需要将firebase.json上的主机指定为

“模拟器”:{
“firestore”:{
“端口”:8080
“主机”:“0.0.0.0”

},
如果您在物理设备上进行测试,那么使用计算机的IP地址进行连接会更好。您可以使用内置变量:
Constants.manifest.debuggerHost?.split(“:”).shift()

在这里写了一个简短的解释:


我认为您需要提供比“无法访问”更多的调试信息。这很有效!非常感谢:)