6

I've set up a react native app and want to use xcode to build/run the projectName.xcworkspace file but I run into this error.

I tried the same with a brand new react native project I created without changing anything and I get the same error. What does this mean and how do I solve it?

This is the error

Jossif Elefteriadis
  • 167
  • 1
  • 2
  • 12
  • Does this answer your question? [What is the meaning of 'No bundle URL present' in react-native?](https://stackoverflow.com/questions/42610070/what-is-the-meaning-of-no-bundle-url-present-in-react-native) – Andrew Jun 22 '23 at 12:35

3 Answers3

2

I know this was asked one year ago but maybe this answer will be helpful too, especially if somebody runs xcode 14.3.1(latest for today)

I tried to clean the build folder and recompile and it just stays the same.

Solution: click the "reload" button at the bottom of the error message and the metro console window should show that now it loads the application.

Saraf
  • 200
  • 10
1

This usually means that your app is not connected to your localhost (metro bundler is not running). To solve this, you can try running the following commands: react-native start, then react-native run-ios (this will automatically build the app so there is no need to build it in xcode).

If the problem still persists, then you might have to check your localhost port and make sure that the app is using port 8081.

alnln222
  • 11
  • 2
  • So I can do this once and then just run in xcode or will I still need to run npx react-native start? I tried with npm start and then run in xcode and that worked as well – Jossif Elefteriadis Jan 20 '22 at 20:59
  • I think after you run it once and it is configured, you just have to call `npx react-native start` to watch your code, and next time you can build it either through xcode or the run-ios command. – alnln222 Jan 21 '22 at 17:05
1

run

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

in your root folder

Preetika
  • 702
  • 8
  • 21