当我运行一个react-native项目时,我得到一个错误,没有bundle URL,但我不知道我做了什么错误,我很困惑。
当前回答
步骤1: 在xcode中打开。xcodeworkspace项目,通过“Terminal”导航, “开放/ ios /。xcodeworkspace"按Enter键。
步骤2: 删除主机。Jsbundle文件
步骤3: 回到VS Code,输入这个, React-native bundle——entry-file index.js——platform ios——dev false——bundle-output ios/main。Jsbundle——assets-dest ios
这将生成新的主线。jsbundle文件。
步骤4: react-native run-ios
你不会再次看到错误
其他回答
这个问题发生在我身上,因为地铁捆绑机启动并收到焦点,而我正在另一个窗口的键盘上打字。我不小心输入了新打开的终端窗口,导致地铁捆扎机崩溃。重新运行react-native run-ios并耐心等待修复了它。
以下步骤:
用xcode打开ios文件项目 在项目包中删除main。jsbundle文件 通过main添加新的空文件。jsbundle名字 运行comment: react-native bundle——entry-file index.js——platform ios——dev false——bundle-output ios/main。Jsbundle——assets-dest ios 现在是react-native run-ios
youtube链接:https://www.youtube.com/watch?v=eCs2GsWNkoo
执行如下命令:
killall -9 node
rm -rf ios/build
react-native run-ios
它将打开launchpacker .command,应用程序将安装在ios模拟器上
对于我的用例,我必须删除node_modules目录并运行npm install。
$ rm -rf node_modules (make sure you're in the ios project directory)
$ npm install
如果你得到错误“dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58。Dylib”,执行以下操作:
$ brew uninstall --force node --ignore-dependencies node
$ brew uninstall icu4c --ignore-dependencies icu4c
$ brew install icu4c
$ brew unlink icu4c && brew link icu4c --force
$ brew install node
$ npm install
在我的情况下,终端抛出绝对没有错误,问题是我的mac的vpn连接,所以我不得不断开vpn,问题得到了解决。
推荐文章
- 如何在iOS中使用Swift编程segue
- Swift -整数转换为小时/分钟/秒
- Swift:声明一个空字典
- React钩子:从回调中访问最新状态
- 在成功提交我的应用程序后,“太多符号文件”
- 首先添加一个UIView,甚至是导航栏
- 我如何改变UIButton标题颜色?
- 在Swift中如何调用GCD主线程上的参数方法?
- NSLayoutConstraints是可动画的吗?
- iOS -构建失败,CocoaPods无法找到头文件
- React-Native:应用程序未注册错误
- 禁用react native按钮
- CFNetwork SSLHandshake iOS 9失败
- 请求失败:不可接受的内容类型:文本/html使用AFNetworking 2.0
- 缺少推荐的图标文件-该包不包含iPhone / iPod Touch的应用程序图标,像素为“120x120”,png格式