react-native: Can't build release version of app - __fbBatchedBridge is undefined
I’ve got an app ready to go live, but I’m unable to build a release version.
Steps I took:
- In Xcode, edited the scheme and set Build Configuration to Release and unchecked “Debug executable.”
- In Terminal, ran
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --resetCache
- Set Xcode build target to Simulator (5s, iOS 9.3) and hit run.
I get the following error:
2016-02-04 18:59:17.582 [error][tid:com.facebook.React.JavaScript] Unable to execute JS call: __fbBatchedBridge is undefined
2016-02-04 18:59:17.585 SydTechEco[76215:10166934] *** Terminating app due to uncaught exception 'RCTFatalException: Unable to execute JS call: __fbBatchedBridge is undefined', reason: 'Unable to execute JS call: __fbBatchedBridge is undefined'
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 56 (16 by maintainers)
I’m not sure if my case applies here but I had the “__fbBatchedBridge is undefined” issue when I tried to build a production app and the reason was that my “schema” in XCode was set to “Debug”. --> Changing to “Release” fixed the issue.
+1 on 0.22.2
+1 on 0.25.1
Nice to see some other voices join in here. I still feel that, out of the box, it should not fail when using bundle mode in the simulator.
I got this same error on 0.20.0, and it was because my Appdelegate.m file had the line for running on the simulator uncommented, and I was trying to run on a physical device. I switched back to the other line and it ran fine.
still seeing this with RN 0.33.0 and React 15.3.1
Similar to @kwelch, I needed to do a manual upgrade from 0.13 -> 0.14. Was able to fix issue on 0.21.0 by following the Manual Upgrades section of https://facebook.github.io/react-native/docs/upgrading.html#from-0-13-to-0-14
I also think this is wrong. Especially since Facebook (!!) requires a working Simulator version for App Review. It makes much more sense to use Debug / Release configs as a determinator whether a bundled version should be created / used, or whether the local packager should be used.
You can uncomment these line in react-native-xcode.sh: https://github.com/facebook/react-native/blob/master/packager/react-native-xcode.sh#L15-L18 and make sure your rootview/bridge config points to the right JS file.
Still seeing this on 0.46.1
Still seeing this on 0.45.0
+1 on 0.24.1
I’m getting it on 0.47.1
My app starting to show this error in the middle of development. Delete the app from the simulator and run
react-native run-ios
.25 to .29 - getting this. Can’t seem to get it to work with any of the above suggestions. Only breaks on a physical device, not emulator.
also fall into this and found out the script is
"Skipping bundling for Simulator platform"
… I think it’s wrong, you shouldn’t prevent us from testing the “bundle” mode on the simulator.