No Bundle URL Found - React Native Getting Started

Viewed 5208

I am following the steps at React Native Getting Started and I am unable to get the application running. When I run cd /Users/brandonsmac/SysDevMobileApps/ReactNative/AwesomeApp" && npx react-native run-ios

It will say successfully built, but when I got to view the screen it says "Bundle URL Missing"

I notice there is the following post that I tried react-native No bundle URL present and I still get the error.

Also, I can show what happens when I run it with the expo but that fails as well.

Can someone please help me?

3 Answers

The answer I found here worked. https://onexlab-io.medium.com/no-bundle-url-present-fixed-ca2688a80f66

Step 1:

  • Open the package.json file and add the following line '"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='iOS'"'
  • Now your file looks like this following screenshot

[Step 1][

Step 2:

  • Run following command. It will generate main.jsbundle file

    yarn build:ios or npm run build:ios

Step 3:

  • Open iOS project in Xcode show as following screenshot

Step 3 Part 1

  • Select -> Target → Build Phases under Copy Bundle Resources click on the plus button as following screenshot.

Step 3 Part 2

  • It will show you the prompt as shown below. Then select the file main.jsbundle and click on the Add button

Step 3 Part 3

Step 4:

Try to re-run your app

npx react-native run-ios
or
react-native run-ios

Step 5:

TA DA!! Step 5 Complete

For me it was fixed by unchecking run script only when installing here:

Targets -> Build Phases -> Bundle React Native code and images

Bundle React Native code and images

What work for me is to

  1. Click on the App Target
  2. Look for Bundle React Native code and images
  3. Uncheck run script for install builds only
  4. Uncheck run script based on dependency analysis. enter image description here
Related