当我运行一个react-native项目时,我得到一个错误,没有bundle URL,但我不知道我做了什么错误,我很困惑。


当前回答

我也有同样的错误,只能通过Xcode运行应用程序。React-native run-ios不起作用。要解决这个问题,你需要删除YOUR_PROJECT/ios/build/的build文件夹。在此之后,您应该能够再次通过react-native run-ios运行您的应用程序。希望这能有所帮助。

其他回答

这个问题发生在我身上,因为地铁捆绑机启动并收到焦点,而我正在另一个窗口的键盘上打字。我不小心输入了新打开的终端窗口,导致地铁捆扎机崩溃。重新运行react-native run-ios并耐心等待修复了它。

...发生这种情况的另一个原因是,如果你已经安装了Visual Studio Code React Native Tools,但你一直试图在终端中使用React Native:它第一次会工作,但随后它会停止并显示红色的no bundle屏幕。

从vscode启动react native工作得很好…

这是react-native v0.42.1的一个问题。尝试关闭所有终端和XCode实例并运行:

launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
watchman version
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模拟器上