react-native icon indicating copy to clipboard operation
react-native copied to clipboard

RN 0.60.5 iOS release build "No bundle URL present" after updating

Open rnnyrk opened this issue 5 years ago • 82 comments

I've just updated my project from React Native 0.59.9 to 0.60.5 with react-native upgrade and the update helper mentioned in the official blog post. Although my project is already a little "complex" because it's using some libraries etc. it seemed the update was successful.

But unfortunately my app won't work with the Test - Release scheme anymore. On the debug scheme it works without any problems. The release also reaches the "Build succeeded" status, but as soon the app launches it's stuck because of the "No bundle URL present" error (see also my attached Xcode screenshot).

I've tried everything I could find on the internet so far. Re-installing the NPM dependencies and Pods; removing the build folder, changing the NSAppTransportSecurity in the Info.plist, but it won't resolve the issue.. The deployed app via TestFlight breaks as well on startup.

React Native version:

System: OS: macOS 10.14.6 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Memory: 430.30 MB / 8.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.11.0 - ~/.nvm/versions/node/v10.11.0/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.11.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 23, 26, 28, 29 Build Tools: 28.0.3, 29.0.0 System Images: android-29 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.60.5 => 0.60.5 npmGlobalPackages: react-native-cli: 2.0.1

Steps To Reproduce

  1. Update react-native from 0.59.9 to 0.60.5
  2. Remove node_modules, ios/Pods, ios/build and Podfile.lock
  3. Re-install node_modules and run pod install
  4. Open Project.xcworkspace
  5. Select the scheme "Project - Test" go to "Edit scheme > Run > Build Configuration" and change the scheme to "Test - Release"
  6. Build the project (on device or simulator, doesn't matter)
  7. "Build succeeded" and app starts
  8. App is stuck on splash screen and Xcode shows the error as in the attached screenshot

Files / Code

Currently these are my Info.plist, Podfile and package.json:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDisplayName</key>
	<string>Jobner</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>2</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
	<key>UIStatusBarHidden</key>
	<true/>
	<key>ITSAppUsesNonExemptEncryption</key>
	<false/>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string>Your location is required for searching jobs near you</string>
	<key>NSLocationAlwaysUsageDescription</key>
	<string>Your location is required for searching jobs near you</string>
  <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>whatsapp</string>
  </array>
</dict>
</plist>
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

project 'Project',
  'Prod - Debug' => :debug,
  'Acc - Debug' => :debug,
  'Test - Debug' => :debug,
  'Prod - Release' => :release,
  'Acc - Release' => :release,
  'Test - Release' => :release

target 'Project' do
  # Pods for Project
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  target 'ProjectTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end
{
  "name": "project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "lint": "eslint --ext .jsx --ext .js src/",
    "ios": "react-native run-ios --scheme \"Project - Test\" --configuration \"Test - Debug\"",
    "android": "ENVFILE=.env.dev react-native run-android --variant=devDebug --appIdSuffix=dev",
    "postinstall": "npx jetify"
  },
  "dependencies": {
    "@aws-amplify/auth": "1.2.31",
    "@aws-amplify/core": "1.1.0",
    "@babel/polyfill": "7.4.4",
    "@react-native-community/async-storage": "1.6.1",
    "accounting": "0.4.1",
    "amazon-cognito-identity-js": "3.0.15",
    "cross-fetch": "3.0.4",
    "dayjs": "1.8.15",
    "iban": "0.0.12",
    "prop-types": "15.7.2",
    "qs": "6.7.0",
    "react": "16.9.0",
    "react-geocode": "0.1.2",
    "react-native": "0.60.5",
    "react-native-android-keyboard-adjust": "^1.2.0",
    "react-native-bootsplash": "1.0.1",
    "react-native-config": "luggit/react-native-config#master",
    "react-native-datepicker": "1.7.2",
    "react-native-device-info": "2.3.2",
    "react-native-gesture-handler": "1.3.0",
    "react-native-keyboard-aware-scroll-view": "0.9.1",
    "react-native-keyboard-spacer": "^0.4.1",
    "react-native-linear-gradient": "2.5.6",
    "react-native-pdf": "5.1.4",
    "react-native-svg": "9.8.4",
    "react-navigation": "3.11.0",
    "react-redux": "7.1.1",
    "redux": "4.0.4",
    "redux-devtools-extension": "2.13.8",
    "redux-thunk": "2.3.0",
    "reselect": "^4.0.0",
    "rn-fetch-blob": "0.10.16",
    "styled-components": "4.3.2"
  },
  "devDependencies": {
    "@babel/core": "7.5.5",
    "@babel/plugin-proposal-export-default-from": "7.5.2",
    "@babel/plugin-proposal-export-namespace-from": "7.5.2",
    "@babel/plugin-syntax-dynamic-import": "7.2.0",
    "@babel/runtime": "7.5.5",
    "babel-eslint": "10.0.2",
    "babel-plugin-module-resolver": "3.2.0",
    "babel-plugin-styled-components": "1.10.6",
    "eslint": "^5.16.0",
    "eslint-config-react-app": "^4.0.1",
    "eslint-import-resolver-babel-module": "5.1.0",
    "eslint-plugin-flowtype": "3.13.0",
    "eslint-plugin-import": "2.18.2",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-react": "7.14.3",
    "eslint-plugin-react-hooks": "1.6.1",
    "eslint-plugin-react-native": "3.7.0",
    "jetifier": "^1.6.4",
    "metro-react-native-babel-preset": "0.56.0"
  },
  "xcodeSchemes": {
    "Debug": [
      "Test - Debug",
      "Acc - Debug",
      "Prod - Debug"
    ],
    "Release": [
      "Test - Release",
      "Acc - Release",
      "Prod - Release"
    ],
    "projectDirectory": "ios",
    "settings": {}
  },
  "rnpm": {
    "assets": [
      "./src/app/static/fonts/"
    ]
  }
}

The AppDelegate.m should link to the correct bundle file right? This code is in there:


- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
Screenshot 2019-09-04 at 20 44 20

rnnyrk avatar Sep 04 '19 19:09 rnnyrk

I've found a solution in this Stack Overflow post. Following these steps you can create a main.jsbundle and assets folder and add it to your project.

  1. Run the following command: react-native bundle --dev false --platform ios --entry-file index.js --bundle-output ios/main.jsbundle --assets-dest ./ios
  2. Add main.jsbundle and assets directory to Xcode by dragging them in your project.

Although this feels like a temporary solution.. I've got two main.jsbundle files right now. Can I delete the one in my project folder? And the assets folder includes some node modules do I have this command every time I add new modules and manually drag the assets in my project root?

Also when I build it via CI/CD (Bitrise) there is no main.jsbundle created in the root since it is ignored by default in .gitignore. So my TestFlight builds are still failing. How to handle this?

What exactly is happening here?

Screenshot 2019-09-05 at 09 46 52

rnnyrk avatar Sep 05 '19 07:09 rnnyrk

Resolved the issue. Seemed like my project was missing a shell script to automatically build the bundle and assets under "Build Phases > Bundle React Native code and images". Also Xcode was crashing when I opened this section.

I opened the file /ios/Project.xcodeproj/project.pbxproj, searched for this part:

/* Begin PBXShellScriptBuildPhase section */
		00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "Bundle React Native code and images";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
		};

and added the shell script, so I ended up with:

/* Begin PBXShellScriptBuildPhase section */
		00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "Bundle React Native code and images";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
		};

Hopefully this prevents others to spend 2 days on this ;)

rnnyrk avatar Sep 05 '19 09:09 rnnyrk

there is already this line in my file, however, when running use of my device or error continues. He is only working on the emulator

arthurstockler avatar Sep 12 '19 22:09 arthurstockler

got this issue coming from RN0.60.5 to RN0.61.1, I experience so many issue upgrading to the latest version. Then the only issue I'm facing now is this one. The Metro bundle was not initiating and I need to manually run "react-native start" which is not good. I hope someone can find solution for this issue.

eggybot avatar Sep 26 '19 15:09 eggybot

same problem to update 0.59.9 to 0.61.1

ivanguimam avatar Sep 26 '19 17:09 ivanguimam

same here

ivannovazzi avatar Sep 30 '19 16:09 ivannovazzi

+1

samuthekid avatar Oct 02 '19 22:10 samuthekid

same problem here

Andriiklymiuk avatar Oct 04 '19 07:10 Andriiklymiuk

Same issue for me.

2019-10-07 17:56:49.686 [fatal][tid:main] No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
2019-10-07 17:56:49.692042+0200 SesameApp[3795:761740] No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
2019-10-07 17:56:49.693555+0200 SesameApp[3795:761740] *** Terminating app due to uncaught exception 'RCTFatalException: No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.', reason: 'No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.'
*** First throw call stack:
(0x1ee34298c 0x1ed51b9f8 0x1000dc79c 0x1000f3c6c 0x1edd80a38 0x1edd817d4 0x1edd2f008 0x1ee2d432c 0x1ee2cf264 0x1ee2ce7c0 0x1f04cf79c 0x21ad99c38 0x1000c1f98 0x1edd928e0)
libc++abi.dylib: terminating with uncaught exception of type NSException

franckboudraa avatar Oct 08 '19 08:10 franckboudraa

Resolved the issue. Seemed like my project was missing a shell script to automatically build the bundle and assets under "Build Phases > Bundle React Native code and images". Also Xcode was crashing when I opened this section.

I opened the file /ios/Project.xcodeproj/project.pbxproj, searched for this part:

/* Begin PBXShellScriptBuildPhase section */
		00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "Bundle React Native code and images";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
		};

and added the shell script, so I ended up with:

/* Begin PBXShellScriptBuildPhase section */
		00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "Bundle React Native code and images";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
		};

Hopefully this prevents others to spend 2 days on this ;)

I downgraded to Xcode 10.3 and applied that, it's working now thank you.

franckboudraa avatar Oct 08 '19 12:10 franckboudraa

It happened to me as well when I upgraded react-native from '0.59.9' to '0.61.2'. For anyone still experiencing this, after the upgrade please check if there is a build phase in xcode called Start packager. If not click the + sign and choose 'new run script phase'. You will see a new phase called 'Run script' added to the bottom of the build phases. Add this shell script code

export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}" echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${SRCROOT}/../node_modules/react-native/scripts/.packager.env" if [ -z "${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly" exit 2 fi else open "$SRCROOT/../node_modules/react-native/scripts/launchPackager.command" || echo "Can't start packager automatically" fi fi

Change its name to 'Start packager' and move it to the between 'Check Pods Manifest.lock' and 'Compile sources'. I hope it helps.

ergunyasar avatar Oct 22 '19 12:10 ergunyasar

I'm having the same issue. I open my bundler manually and even though it seems like the app can't reach it even though NSAppTraspotSecurity is correct. Anyone has found solutions for this?

NirvaleO avatar Nov 02 '19 16:11 NirvaleO

Same for me, @ergunyasar your solution doesn't work. It gives me an error during build.

davidmarinangeli avatar Nov 06 '19 18:11 davidmarinangeli

I re-opened this issue since a lot of people seem to have encounter the same error with assumedly another solution.

rnnyrk avatar Nov 07 '19 10:11 rnnyrk

The script that I have found in another issue and that is working for me is the following:

export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"
echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${SRCROOT}/../node_modules/react-native/scripts/.packager.env"
if [ -z "${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then
if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then
if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then
echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"
exit 2
fi
else
open "$SRCROOT/../node_modules/react-native/scripts/launchPackager.command" || echo "Can't start packager automatically"
fi
fi

All the steps are pretty much the same that @ergunyasar wrote: the only thing that changes is the script code above.

RN 0.61.3

davidmarinangeli avatar Nov 07 '19 12:11 davidmarinangeli

Yes! Thx a lot @davidmarinangeli and @ergunyasar adding the script (David edition) worked for me (after trying a bunch of the other solutions out there).

CooperCodeComposer avatar Nov 07 '19 23:11 CooperCodeComposer

I was trying to go through the official "Getting Started" and I faced the same issue following all the steps. The expo "Getting started" steps are working though.

Setup:

  • Latest MacOS,
  • Latest node
  • Latest react-native.

First error (default port)

First, when I keep the default port, it will crash with a port in use error: (Note that there is nothing listening on that port. lsof -t -i:8081 return nothing

npx react-native run-ios

Port 8081 already in use, packager is either not running or not running correctly
Command PhaseScriptExecution failed with a nonzero exit code

** BUILD FAILED **

The following build commands failed:
	PhaseScriptExecution Start\ Packager /AwesomeTSProject2/ios/build/AwesomeTSProject2/Build/Intermediates.noindex/AwesomeTSProject2.build/Debug-iphonesimulator/AwesomeTSProject2.build/Script-FD10A7F022414F080027D42C.sh
(1 failure)

Second Error with custom port (no bundle error)

Then if I change the port npx react-native run-ios --port 9092

I got the same error as describe here

no bundle url present

@rnnyrk solution works fine as long as I keep specifying a custom port.

When I use the default, I got the first error even after the fix.

francisl avatar Dec 10 '19 18:12 francisl

I use @davidbiedenbach solution and i had to combinate it with this solution: https://stackoverflow.com/a/54230598/2360269

NetPumi2 avatar Dec 17 '19 14:12 NetPumi2

@eggybot Are you using iterm2 or integrated terminal in VS Code? If so, run react-native run-ios command from a default terminal. For me, it solved the issue. I couldn't believe how I spent a few hours on this.

jeffminsungkim avatar Dec 26 '19 10:12 jeffminsungkim

@rnnyrk @arthurstockler @eggybot @ivanguimam @ivannovazzi
this video saved me , I have tried https://www.youtube.com/watch?v=eCs2GsWNkoo

shixiaoquan avatar Dec 31 '19 02:12 shixiaoquan

It happened to me as well when I upgraded react-native from '0.59.9' to '0.61.2'. For anyone still experiencing this, after the upgrade please check if there is a build phase in xcode called Start packager. If not click the + sign and choose 'new run script phase'. You will see a new phase called 'Run script' added to the bottom of the build phases. Add this shell script code

where is the + sign? @ergunyasar

LeonaYoung avatar Jan 03 '20 17:01 LeonaYoung

All,

I am on the latest version of react-native cli and react-native, react-native-cli: 2.0.1 react-native: 0.61.5 I am trying to initialise a brand new project and run it in the iOS simulator and have run into this issue consistently no matter what I try , i. e create a new project, remove the build directory in iOS and try running it.

However the video suggestion did work but it had a lot of unnecessary side effects like losing hot reloading etc.

Is there a fix available for this issue ? if downgrading is an option I am happy to downgrade the cli and react-native versions.

Thanks in advance for any help.

vj-raghavan avatar Jan 08 '20 02:01 vj-raghavan

I am upgrading from react native 0.59.10 to 0.60.6 and i am facing this issue, i have tried all the solutions/suggestions posted in this thread. But no luck 😞 If anyone has found a solution please help.

Rutvik17 avatar Jan 08 '20 20:01 Rutvik17

All,

I am on the latest version of react-native cli and react-native, react-native-cli: 2.0.1 react-native: 0.61.5 I am trying to initialise a brand new project and run it in the iOS simulator and have run into this issue consistently no matter what I try , i. e create a new project, remove the build directory in iOS and try running it.

However the video suggestion did work but it had a lot of unnecessary side effects like losing hot reloading etc.

Is there a fix available for this issue ? if downgrading is an option I am happy to downgrade the cli and react-native versions.

Thanks in advance for any help.

Okay, Here is what happened now. I created a new project and initialised it as per usual and it worked. I used npx react-native run-ios and it seems to have worked without any issues.. Previously I was using react-native run-ios. Which I reckon may have used a older version of react-native hanging around somewhere in my refs.

vj-raghavan avatar Jan 08 '20 22:01 vj-raghavan

I am upgrading from react native 0.59.10 to 0.60.6 and i am facing this issue, i have tried all the solutions/suggestions posted in this thread. But no luck If anyone has found a solution please help.

I upgrade xcode to the lasted version, it worked

shixiaoquan avatar Jan 08 '20 23:01 shixiaoquan

If none of these have worked, my issue was with the packager (responsible for the bundle) build phase disappearing.

Check out the solution for the packager problem here: https://github.com/facebook/react-native/issues/25585

Also, make sure react-native-cli doesn't call an old globally-installed version and instead the one installed in your project by react-native. Run npm uninstall -g react-native-cli and use yarn commands to use react-native-cli.

alixq avatar Jan 09 '20 11:01 alixq

Hi there, I got the same error starting a new project at 0.61.5. I deleted the ios/build folder and re-run the react-native run-ios.

It worked for me.

Thanks

diazevedo avatar Jan 12 '20 07:01 diazevedo

What worked for me is a combination of the solutions that have been posted.

  1. Delete ios/build folder
  2. Run react-native start (to manually launch the bundler)
  3. Open new tab and run react-native run-ios

This worked for me.

olczake avatar Jan 13 '20 14:01 olczake

I encountered this error during a 0.60+ upgrade, even when I can verify that the metro bundler is running on port 8081. It seems that react-native is failing to detect the existence of a running server on that port -- or perhaps its looking for a different port altogether? using the --port flag has no benefit. deleting ios/build and reinstalling dependencies has no effect

nickarora avatar Feb 05 '20 21:02 nickarora

I had a similar issue in which the package was indeed running as I started it manually yet the app was still complaining with the "No bundle URL present" error screen on [email protected] I noticed in the logs of xcode that something was trying to access port 8083:

Task <>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x600002d86550 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://localhost:8083/status, NSErrorFailingURLKey=http://localhost:8083/status, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}

So I (naively) tried running the packager on that same port, 8083, then reloaded the app in the simulator and it magically worked:

npx react-native start --port 8083

Hope this helps at least one poor(t) soul out there in the wild 🚀

Davidster avatar Feb 11 '20 01:02 Davidster