首页 > 解决方案 > React Native White screen with any crash or error iOS

问题描述

当我尝试在我的 macbook 上启动我的项目时,我最终得到一个白屏,没有任何错误或崩溃。我在另外两台机器上试过,结果一样。我在 XCode 上没有错误消息,也在终端上运行。我在控制台上没有错误消息(当我激活“Debug JS Remotly”时):

反应本机调试器 我当然尝试过多次删除“node_modules” npm install。该应用程序已经在 Macbook(我们的开发人员之一)上运行了几个月,我们拥有完全相同的配置、相同的源代码 (git)。我还尝试更改入口点并放置一些超基本的东西,如下所示:

import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';

export default class BoldAndBeautiful extends Component {
  render() {
    return (
      <Text style={{fontWeight: 'bold'}}>
        I am bold
        <Text style={{color: 'red'}}>
          and red
        </Text>
      </Text>
    );
  }
}

但是在这里,当我多次执行 CMD+R 时,应用程序最终会自行启动并将我带到 onBoarding,但就好像应用程序已冻结(冻结),我无法单击按钮,也无法滚动, 也不调用 Shake Gesture 弹出窗口(允许激活调试功能的弹出窗口)

我尝试了几个模拟器(iPhone X、iPhone 6s、iPhone 8...)和几个不同的版本(iOs 10、iOs 11、iOs 12)

XCode 版本:10.1 节点版本:v8.11.3 我的 package.json:

    "@ptomasroos/react-native-multi-slider": "^1.0.0",
    "moment": "^2.22.2",
    "native-base": "^2.7.2",
    "prop-types": "latest",
    "proxy-polyfill": "^0.3.0",
    "react": "16.3.1",
    "react-native": "~0.55.2",
    "react-native-animatable": "^1.3.0",
    "react-native-background-fetch": "^2.4.3",
    "react-native-collapsible": "^0.13.0",
    "react-native-device-info": "^0.21.5",
    "react-native-elements": "^0.19.1",
    "react-native-fast-image": "^5.0.3",
    "react-native-flip-toggle-button": "^1.0.5",
    "react-native-image-progress": "^1.1.1",
    "react-native-image-resizer": "^1.0.0",
    "react-native-linear-gradient": "^2.4.0",
    "react-native-localization": "^2.0.2",
    "react-native-mail": "^3.0.6",
    "react-native-material-textfield": "^0.12.0",
    "react-native-navigation": "^2.0.2425",
    "react-native-offline": "^3.11.0",
    "react-native-progress": "^3.5.0",
    "react-native-queue": "^1.2.1",
    "react-native-secure-key-store": "^2.0.0",
    "react-native-shared-group-preferences": "^1.1.15",
    "react-native-vector-icons": "^4.6.0",
    "react-native-version-check": "^3.0.0-rc.5",
    "react-native-wheel-picker": "^1.2.0",
    "react-redux": "^5.0.7",
    "realm": "^2.17.0",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "redux-saga": "^0.16.0",
    "redux-thunk": "^2.3.0",
    "typescript": "^2.9.2"

预先感谢您的帮助

标签: iosxcodereact-native

解决方案


我刚刚找到了!您所要做的就是使用 Yarn!我使用 Yarn 再次开始整个安装,这里是 yarn.lock 的差异:

吉特克拉肯


推荐阅读