-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.19 - Unable to run in simulator using main.jsbundle - Unable to execute JS call: __fbBatchedBridge is undefined #5820
Comments
Hey tdugger, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
Also, when I did the react-native upgrade, I ran across many files that I have changed that it wanted to overwrite. I looked at each of them carefully (with the diff option) and I didn't notice anything that was new in .19 that I needed in those files so I chose not to overwrite them. We really need an option of "merge" and have it add <<<< and >>>> lines that we can then examine the differences better. So, there could have been something that I needed to update but didn't. |
Even going back to 0.18.1, didn't help. I can run through the react packager, but can't through the main.jsbundle and I used to be able to. I think there is no going back from 0.18.1 since .19 upgrade did change some files. But I'm stuck where the only way to run my app is through the react packager, I can't install on device and use main.jsbundle. |
I did finally getting working again with 0.18.1. I added back the build phase step that runs the So, basically, with 0.19, I'm unable to run with main.jsbundle unless I'm running from the device (in which case I need that react-native-xcode.sh script as a build phase, but when running from the react packager process, I have to remove the script as a build phase). With .19, I can't run in the simulator using the main.jsbundle and this is a problem for others that need to run my app. It's also a problem because I can no longer put my app on appetize.io which requires a simulator build (and when running app on appetize.io you can't connect to a react packager). |
Something changed in .19 that causes problem with running in simulator using the main.jsbundle and that is a showstopper for appetize.io, and requires manual code changes to put IP in AppDelegate.m and Info.plist if need to run in simulator. |
+1 Is this issue a result of this change? 5f0ef12 I personally think that we should at least be able to do release builds to the simulator running a local JS bundle. |
@frantic @skevy Is there a way to introduce a flag in the xcode project and I think at the very least, we should always bundle the JS and assets when running a release build. It doesn't seem like a whole lot of sense that a user would run a release build on the simulator and still depend on the dev server, since the goal of running a release build is to test production scenarios. |
@frantic I think rather than depending on whether or not we're building for the simulator, we should depend on whether or not we're doing a Debug or Release build (so, check $CONFIGURATION). Thoughts? |
@tdugger BTW, does appetize.io require a debug build? (i doubt so, just wanna confirm) |
@geof90 no, appetize.io doesn't require a debug build. |
Ran into this issue today and it was non-obvious to me, spent a bit of time digging to end up here. |
Having this same issue after upgrading to .18 and also tried .20. __fbBatchedBridge is undefined when using offline bundle, both on simulator and on device. |
I ran into a similar issue with the I was able to resolve it as follows:
|
I have a PR out that changes the shell script to continue creating the offline package if not in the "Debug" build config, and also updated the comments in the |
I can't get my iOS app running with a pre-bundled file. Please take a look at this issue and give me some hints, this is driving me nuts. Thanks. |
Summary:**Problem**: As seen in facebook#5820, many devs are confused by the fact that the offline bundle is not generated when running against the simulator, even when running in the "Release" configuration which is supposed to mimic "production" scenarios. This pull request is a small change that fixes facebook#5820 by updating the `react-native-xcode.sh` shell script to still generate the ofline bundle during Release configuration. It also updates `AppDelegate.m` to better document this behaviour in the comments so as to avoid any surprises. **Test plan**: This is a simple change, the two tests done were 1. In a new React Native project, verify that an offline build is not generated when running against the simulator in "Debug" configuration as per normal. 2. Change to a "Release" configuration via Product > Scheme > Edit Scheme in XCode, then verify that the project runs with the offline build generated. ![screen shot 2016-02 Closes facebook#6119 Differential Revision: D2970755 Pulled By: javache fb-gh-sync-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617 shipit-source-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617
I don't think this issue is resolved even with react-native version 23 and 25. How is this marked closed? I cannot still run emulator with offline bundle and keep getting fbBatchedBridge undefined error. Can someone re-open this and investigate please? |
Moreover this is NOT documented on the docs for running in offline mode. I literally spent one day trying to arrive at this issue. |
I got the same error with React-Native 0.26 using a remote bundle (i.e. bundle served by the packager on localhost, running the app on simulator of course). When I access the bundle URL via the browser I get the bundled JS file with no problems. I noticed that the following is printed in Xcode console panel:
So the first line of this chunk of error messages, which says "Error: babelHelpers.typeof is not a function.", made me suspect that this has something to do with Babel. I indeed used Babel for running tests and I noticed that the version of |
For those like me who may spend a day figuring out why they have the error "Unable to execute JS call: __fbBatchedBridge is undefined" after they upgrade to OS x El Capitan 10.11 with react-native 0.29 |
Summary:**Problem**: As seen in facebook/react-native#5820, many devs are confused by the fact that the offline bundle is not generated when running against the simulator, even when running in the "Release" configuration which is supposed to mimic "production" scenarios. This pull request is a small change that fixes facebook/react-native#5820 by updating the `react-native-xcode.sh` shell script to still generate the ofline bundle during Release configuration. It also updates `AppDelegate.m` to better document this behaviour in the comments so as to avoid any surprises. **Test plan**: This is a simple change, the two tests done were 1. In a new React Native project, verify that an offline build is not generated when running against the simulator in "Debug" configuration as per normal. 2. Change to a "Release" configuration via Product > Scheme > Edit Scheme in XCode, then verify that the project runs with the offline build generated. ![screen shot 2016-02 Closes facebook/react-native#6119 Differential Revision: D2970755 Pulled By: javache fb-gh-sync-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617 shipit-source-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617
Summary:**Problem**: As seen in facebook/react-native#5820, many devs are confused by the fact that the offline bundle is not generated when running against the simulator, even when running in the "Release" configuration which is supposed to mimic "production" scenarios. This pull request is a small change that fixes facebook/react-native#5820 by updating the `react-native-xcode.sh` shell script to still generate the ofline bundle during Release configuration. It also updates `AppDelegate.m` to better document this behaviour in the comments so as to avoid any surprises. **Test plan**: This is a simple change, the two tests done were 1. In a new React Native project, verify that an offline build is not generated when running against the simulator in "Debug" configuration as per normal. 2. Change to a "Release" configuration via Product > Scheme > Edit Scheme in XCode, then verify that the project runs with the offline build generated. ![screen shot 2016-02 Closes facebook/react-native#6119 Differential Revision: D2970755 Pulled By: javache fb-gh-sync-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617 shipit-source-id: 64f658512869c73aa19286ca1e3dc6e31b5ac617
I've recently upgraded to 0.19 and my app runs fine if I am getting the javascript from the react packager using this line in AppDelegate.m:
jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.10:8081/index.ios.bundle?platform=ios&dev=true"];
(note that I have to use my IP address here and have that IP added as an App Transport Security Setting exception, I guess because I use google auth in my app).
But to let others run my app through Xcode, while we are developing the backend, I was creating the main.jsbundle using this command:
curl http://localhost:8081/index.ios.bundle -o main.jsbundle
And this worked fine with 0.18.1, but after upgrading to 0.19, if I run the the simulator or even on the device whith this line in AppDelegate.m:
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
I get the error:
Unable to execute JS call: __fbBatchedBride is undefined
I do get this message repeated in the Xcode console.
I've read all stackoverflows and issues that match __fbBatchedBridge is undefined and haven't come up with an answer. I guess dropping back to 0.18.1 and that didn't solve the problem (see comments below).
The text was updated successfully, but these errors were encountered: