【问题标题】:Unable to debug/test my react-native app on expo无法在博览会上调试/测试我的 react-native 应用程序
【发布时间】:2019-08-14 16:22:08
【问题描述】:

我是使用 expo 的 react-native 新手。在打开 expo 应用程序并从 http://localhost:19002/ 扫描 QR 码时,我连接了隧道,但在我的设备中总是出现错误说明出现问题或在 http://localhost:19002/ 我收到错误日志,因为我们注意到您的隧道有问题。这可能是由于我们的隧道提供商出现间歇性问题。如果您无法连接到您的应用程序,请尝试重新启动项目,或将主机切换到局域网。

这是我试图在我的移动设备上测试的代码。

import React from "react";
import { StyleSheet, Text, View, Image } from "react-native";

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.header}>
          <Text style={styles.title}> Cart </Text>
        </View>
        <Text style={styles.paragraph}>
          Change code in the editor and watch it change on your phone! Save to
          get a shareable url.
        </Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    paddingTop: Constants.statusBarHeight,
    backgroundColor: "#ecf0f1",
    padding: 8
  },
  paragraph: {
    margin: 24,
    fontSize: 18,
    fontWeight: "bold",
    textAlign: "center"
  },
  header: {
    display: "flex",
    flex: 1,
    height: "10px",
    width: "100%",
    backgroundColor: "#232323",
    color: "white"
  },
  title: {
    textAlign: "center",
    margin: "0 auto",
    textSize: "6px"
  }
});

【问题讨论】:

    标签: javascript reactjs react-native expo


    【解决方案1】:

    你的调试设备和电脑应该连接到同一个WiFi

    【讨论】:

    • 最初当我在我的设备上安装 expo 应用程序时,它可以工作,但使用几次后它开始显示为回家或重新加载。带有模块 AppRegistry 的未注册可调用模块
    猜你喜欢
    • 2019-04-15
    • 2020-11-26
    • 2018-12-14
    • 1970-01-01
    • 2016-06-28
    • 2018-05-22
    • 2017-07-05
    • 2016-09-10
    • 2021-12-09
    相关资源
    最近更新 更多