Crash iOS - No bundle url present
See original GitHub issueSteps to reproduce the behavior
-Updated our non-expo react native project from 0.57.3 to 0.57.5
-installed react-native-firebase
and react-native-splash-screen
libraries (among others, but these seems to be related)
Expected behavior
-Running the application from Xcode will pickup the bundler / start it and properly start the application
Actual behavior
-running the application via command line react-native run-ios
works fine, but when running from Xcode it fails to find the bundler and crashes on startup.
Make sure you're running a packager server or have included a .jsbundle file in your application bundle. 2018-11-28 11:30:46.161150-0500 Loadboard[81354:4917348] *** 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.
After debuging for a long period, I noticed if I change export NODE_BINARY=node ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh
to use ../node_modules/react-native/scripts/react-native-xcode.sh
instead everything works normally as expected.
On our package.json we have the following:
"xcodeSchemes": { "Debug": [ "Dev" ], "Release": [ "Beta" ], "projectDirectory": "ios", "settings": {} },
and on our build phase Bundle React Native code and images
:
export DEVELOPMENT_BUILD_CONFIGURATIONS="+(Dev|Debug)" export NODE_BINARY=node ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh
Any idea why that might be happening? Let me know if any missing info
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@thekevinbrown This is still a very real issue, we’ve managed to find the solution for this after waisting many hours so i’ll post our findings here in case anyone runs into this again.
This seems to actually be a limitation with cocoapods. When it copies your configurations over, it doesn’t know if they were duplicated from release or debug so it ends up not setting any of the debug flags on these configuration on your cocoa pods project, an easy way to check this is to go to build settings on your Pods project in xcode, search for
preprocessor macros
, you’ll see thatDEBUG=1
is not set for your other debug configurations.To fix this, you’ll need to add a line similar to this under target in your
Podfile
:See http://guides.cocoapods.org/syntax/podfile.html#project for more information about custom configurations
Run pod install again, everything should be great now 😃
You can verify it by checking for the flags as described earlier, hope this helps someone!
For anyone stumbling across this issue @martintreurnicht’s solution works and should be added to the docs.