Greeting!
I'm on a task to upgrade RN from 0.41 to 0.50.4 and I'm running into a weird problem. My App runs fine when XCode Build Configuration is DEBUG on simulator. However, when I change Build Configuration to RELEASE. App crashes immediately on launch.
Failed to load bundle(file:///var/containers/Bundle/Application/.../main.jsbundle) with error:(Error reading bundle /var/containers/Bundle/Application/.../main.jsbundle (null))
I have code push integrated into my app, thus I am using jsCodeLocation = [CodePush bundleURL];
Since running RELEASE mode on iOS device doesn't work. I also tried to run on iOS Simulator with RELEASE Build Config, and the error shows to be
Failed to load bundle(file:///Users/<NAME>/Library/Developer/CoreSimulator/Devices/7EF0AE02-83AF-48DF-9E61-97ADB610D8DA/data/Containers/Bundle/Application/78801DB5-7D2D-4108-9D90-70B457AB6915/MyApp.app/main.jsbundle) with error:(Error reading bundle /Users/Tsunghan/Library/Developer/CoreSimulator/Devices/7EF0AE02-83AF-48DF-9E61-97ADB610D8DA/data/Containers/Bundle/Application/78801DB5-7D2D-4108-9D90-70B457AB6915/MyApp.app/main.jsbundle (null))
When I actually going into find that main.jsbundle
. It appears to be an empty file.
I've created an offline main.jsbundle
and linked with XCode project, it doesn't fix the issue.
I've also tried these solutions:
https://github.com/Microsoft/react-native-code-push/issues/1066
https://github.com/facebook/react-native/issues/15432
But didn't fix the issue either.
It seems like on building through react-native-xcode.sh
, somehow it generates empty main.jsbundle
file
Has anyone solve this issue? Any help is appreciated!
RN version: v0.50.4
RN-code-push version: v5.2.1
node v8.1.0
npm v5.0.3
UPDATE: I solved it by setting nvm 8.1.0 as default