Description
On Xcode 15 (MacOS Sonoma) I have the following error when building my project : Build success but No bundle URL present Make sure you’re running a packager server or have included a .jsbundle file
However, when I build it from command line, everything works.
export NODE_OPTIONS=--openssl-legacy-provider && react-native run-ios --port=8082 --simulator='iPhone 15 Pro' && node node_modules/react-native/local-cli/cli.js start
What’s missing on Xcode? How to solve that?
React Native Version
0.63.3
Output of npx react-native info
System:
OS: macOS 14.0
CPU: (8) arm64 Apple M1 Pro
Memory: 47.94 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 15.0/15A240d - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
Build from Xcode (Debug or Release)
3
Answers
This solution worked for me: https://stackoverflow.com/a/75602510/387912 (thanks to Manil Malla)
main.jsbundle
to "Build Phases > Copy Bundle Resources"In fact, this file was missing.
3 questions remains.
See if this works:
In the Build Phases section of Xcode, find the Bundle React Native Code and Images section and add this at the start
(assuming your homebrew installation hasn’t been installed somewhere non standard)
I faced this problem last month in my old React Native projects. To solve this problem you just have to follow two steps the steps are below
Step 1 Fire this command in your root project
Step 2 You have created main.jsbundle using above command add main.jsbundle to the to "Build Phases > Copy Bundle Resources"
Check this out