You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once your app has been configured and distributed to your users, and you've made some JS changes, it's time to release it to them instantly!
How do we get to the point of our app being configured if we have already set up CodePush?
If I follow the original react-native documentation it tells me to uncomment jsCodeLocation = [[NSBundle mainBundle] and then when I run the build it will write the JS bundle to my app somewhere.
If I've already configured CodePush on my app before ever building an offline bundle, will the behaviour be the same? Or should I manually place the bundle in my project?
So instead of just being lazy and posting the question I decided to test it out.
I've never compiled the app with a bundle, and build + running it in xCode resulted in the following:
(first set schema to production, then build + run)
Packager automatically started
Packager doesn't receive any requests
App crashes: terminating with uncaught exception of type NSException
points to this loop:
// run the run loop
while (kCFRunLoopRunStopped != CFRunLoopRunInMode(kCFRunLoopDefaultMode, ((NSDate *)[NSDate distantFuture]).timeIntervalSinceReferenceDate, NO)) {
RCTAssert(NO, @"not reached assertion"); // runloop spun. that's bad.
}
Not sure if this counts as a bug or not, but it might be convenient to allow usage of CodePush without having manually bundled, or having ran the original react-native code (jsCodeLocation = [[NSBundle mainBundle]) first.
I hope this makes sense and doesn't look too messy, beginner developer here.
The text was updated successfully, but these errors were encountered:
The crash you are seeing is probably due to this issue facebook/react-native#5820. In RN 0.19+, there was a change added to the build script that skipped generating the offline bundle if you are running on the simulator. Therefore the app crashes because the offline bundle cannot be found. I think it has resulted in a lot of confusion in the RN community in general because it is not well documented anywhere. You should not be seeing this crash if you were to run on an actual device.
I recently sent out a PR to RN facebook/react-native#6119 to make the build script generate the offline bundle if the app is run in the "Release" mode. I hope it will get shipped as part of RN 0.21. If not the workaround for now, if you really need to test the offline build update scenario, is to comment out these lines facebook/react-native@5f0ef12 in node_modules/react-native/packager/react-native-xcode.sh
I actually looked at react-native-xcode.sh but just assumed it wasn't running at all. I think for now just linking the bundle files in my .xcodeproj manually works fine, don't really want to add any more exceptions to my .gitignore. Thanks!
Sorry for being nitpicky again!
The following part of the documentation:
How do we get to the point of our app being configured if we have already set up CodePush?
If I follow the original react-native documentation it tells me to uncomment
jsCodeLocation = [[NSBundle mainBundle]
and then when I run the build it will write the JS bundle to my app somewhere.If I've already configured CodePush on my app before ever building an offline bundle, will the behaviour be the same? Or should I manually place the bundle in my project?
So instead of just being lazy and posting the question I decided to test it out.
react-native: 0.20.0
react-native-code-push: ^1.7.3-beta
I've never compiled the app with a bundle, and build + running it in xCode resulted in the following:
(first set schema to production, then build + run)
terminating with uncaught exception of type NSException
points to this loop:
Not sure if this counts as a bug or not, but it might be convenient to allow usage of CodePush without having manually bundled, or having ran the original react-native code (
jsCodeLocation = [[NSBundle mainBundle]
) first.I hope this makes sense and doesn't look too messy, beginner developer here.
The text was updated successfully, but these errors were encountered: