React Native Ios 错误“无法加载包" [英] React Native Ios error 'failed to load bundle'

查看:40
本文介绍了React Native Ios 错误“无法加载包"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始学习 React-Native

I want to start learn React-Native

react-native init
react-native run-ios

我已经尝试了四种图像方法

I have tried four methods of image

推荐答案

我尝试了上述所有解决方案,但都没有奏效.但是这个解决方案适用于我的情况(React-Native 0.57.2):

I tried all the solutions above, but none worked. But this solution works in my case (React-Native 0.57.2) :

https://github.com/facebook/react-native/issues/21490#issuecomment-427240356

1.关闭所有正在运行的 Metro Bundler

1.Close all Metro Bundler running

2.清理缓存

rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; watchman watch-del-all

3.新建项目并安装babel runtime

3.Create a new project and install babel runtime

react-native init awesomeproject
cd awesomeproject
npm install --save-dev @babel/runtime

3.在你的终端中启动 Metro Bundler(不要关闭它)

3.Start Metro Bundler in your terminal (don't close it)

react-native start

4.在终端中打开一个新窗口,然后运行您的应用

4.Open a new window in your terminal,and run your app

react-native run-ios

这篇关于React Native Ios 错误“无法加载包"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆