繁体   English   中英

React Native - 无法在 iOS 中加载包

[英]React Native - Failed to load bundle in iOS

打开应用程序时出现错误屏幕

我是本地 iOS 应用程序开发人员,但我也想了解最新和趋势技术,所以我选择动手进行 React Native。 现在,我在尝试在 iOS 上运行我的 React Native 创建的应用程序时遇到此错误。 我输入命令 react-native run-ios 和模拟器启动,并在该应用程序打开后但在启动时显示此屏幕。

下面的链接中提供了几种解决方案。 请尝试它们。

https://github.com/facebook/react-native/issues/21310

for now after react-native init, since a lot of new changes are coming out, this fix worked for me (I got it from reading other issues):
with npm:
npm install --save-dev @babel/core
npm install --save-dev @babel/runtime
or with yarn:
yarn add --dev @babel/core
yarn add --dev @babel/runtime

if on ios you get _this._registerEvents is not a function, after a successful build
do
npm run start --reset-cache
or
react-native start --reset-cache

对我来说,我现在有一些问题的原因,因为很多新的变化正在出现,比如 Xcode 10 本身是新的,而 react native 尚未与它合并,这个修复对我有用:

使用 npm:

npm install --save @babel/runtime

或用纱线:

纱线添加@babel/runtime

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM