skip to Main Content

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)

Snack, screenshot, or link to a repository

3

Answers


  1. Chosen as BEST ANSWER

    This solution worked for me: https://stackoverflow.com/a/75602510/387912 (thanks to Manil Malla)

    1. I had to manually create the bundle.
    npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
    
    1. Add the main.jsbundle to "Build Phases > Copy Bundle Resources" enter image description here

    In fact, this file was missing.

    3 questions remains.

    • Why it has missing?
    • How to do that automatically?
    • IMPORTANT (with that solution, local images (logo, icon) doesn't work anymore...)

  2. 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

    if [ -d "/opt/homebrew/bin" ] && [ -x "/opt/homebrew/bin" ]; then
        export PATH="$PATH:/opt/homebrew/bin"
    fi
    

    (assuming your homebrew installation hasn’t been installed somewhere non standard)

    Login or Signup to reply.
  3. 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

    react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios
    

    Step 2 You have created main.jsbundle using above command add main.jsbundle to the to "Build Phases > Copy Bundle Resources"enter image description here

    Check this out

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search