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


当前回答

在我的案例中,通过重新启动adb服务器解决了这个问题:adb kill-server && adb start-server

其他回答

关闭当前正在运行的React Packager终端窗口,然后从Xcode重新运行你的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

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

检查您的主机,127.0.0.1 localhost没有被删除 检查网络代理是否未设置 然后NPM install & react-native升级重置你的项目

关闭模拟器和终端。打开一个新的并进入你的项目,然后像这样升级你的react-native:

react-native upgrade

问题:当bundle执行失败时,RCTFatal中的无限递归。