【问题标题】:React Native: Successfully boots simulator, but application does not completely open, index.ios.js buildReact Native:成功启动模拟器,但应用程序未完全打开,index.ios.js 构建
【发布时间】:2019-10-01 17:28:44
【问题描述】:

我的机器上有 Xcode 10.1。

昨天我克隆了一个 React Native 项目,并做了一个 npm installnpm install --save react-native-cli,所以我可以使用模拟器,因为这个项目似乎是为了直接构建并以某种方式从 ipa/ipk 构建中调试的,不知道它是如何工作的,但我习惯于从模拟器中调试。

今天,我尝试启动模拟器,最初它启动到我可以看到应用程序徽标的地步,就这样。我关闭它并尝试重新启动它,它经历了这个:

** BUILD SUCCEEDED **


Installing build/Build/Products/Debug-iphonesimulator/AppName.app
Launching com.nist.appname

但模拟器没有启动。以下 OP 帮助解决了模拟器无法再次启动的问题:

React Native BUILD SUCCEED, but "No devices are booted."

但是,现在模拟器启动了,但应用程序并没有完全启动,它在应用程序徽标的显示处停止。

今天我得知它确实是用react-native-cli 构建的以运行react-native run-ios,但我想我最初希望在package.json 文件中看到它,所以我不知道安装它两次是否会导致问题,但我不这么认为,因为昨天我这样做时并没有给我带来问题。

我相信问题是index.ios.js 构建失败。不知道如何调试。这是index.io.js 文件:

import {AppRegistry} from 'react-native';
import KeyboardManager from 'react-native-keyboard-manager';
import AppName from './App';

KeyboardManager.setToolbarPreviousNextButtonEnable(true);

AppRegistry.registerComponent('AppName', () => AppName);

【问题讨论】:

    标签: reactjs react-native ios-simulator xcode10


    【解决方案1】:

    问题在于 action.js 文件之一中的导入语句。

    不像其他类型文件或常量文件那样import types from './constants';,它有import types from './types';

    在我更正之后,index.ios.js 构建再次成功。

    【讨论】:

      猜你喜欢
      • 2020-05-08
      • 1970-01-01
      • 2019-08-07
      • 2020-11-04
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 2020-12-04
      • 2020-07-23
      相关资源
      最近更新 更多