【问题标题】:react-native red screen errorreact-native 红屏错误
【发布时间】:2016-12-01 05:26:15
【问题描述】:

我已经从 git 安装了新的应用程序,但是我遇到了这个红屏错误,谁能帮帮我。

   ReferenceError: Can't find variable: process (http://10.0.3.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:2506) 
E/unknown:React( 2312): 
E/unknown:React( 2312): Try the following to fix the issue: E/unknown:React( 2312): • Ensure that the packager server is running E/unknown:React( 2312): • Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices 
E/unknown:React( 2312): • Ensure Airplane Mode is disabled E/unknown:React( 2312): • If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device 
E/unknown:React( 2312): • If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081

这个输出是 adb logcat。

我已经创建了github问题,任何人都可以参考isssue

【问题讨论】:

    标签: android react-native genymotion react-native-android


    【解决方案1】:

    您是否按照错误消息中的建议运行adb reverse tcp:8081 tcp:8081?您总是需要在连接物理设备后执行此操作,并且您可能需要对 Genymotion 执行相同操作(从未将其与 React 一起使用)。

    还要确保没有其他进程在端口 8081 上运行:sudo lsof -n -i4TCP:8081 | grep LISTEN。 如果这样做,您可以通过执行kill -9 <PID> 来终止该进程,或者在另一个端口上启动打包程序:react-native start --port 8082

    如果这无济于事,请尝试在基本的 Android 模拟器而不是 Genymotion 上打开应用程序,看看您是否遇到相同的错误。

    【讨论】:

    • 您好,我也使用基本模拟器尝试了这些步骤。它有同样的问题
    【解决方案2】:

    我的问题是升级时 react-native 中的 native-base 模块不匹配。 checkout this issuenpm clean cache

    我也删除了 node_module 并重新安装。

    我选择了native-base": "0.5.15" react-native : "0.33.1" and react is "15.3.1",一切都开始正常了。

    也检查一下facebook troubleshoot

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多