React Native (iOS) app loads nicely on wifi; crashes on LTE/cell

ios, react-native

Solution

This issue is caused by build the app in Debug phase. The only thing you need to do, is going to xCode Product → Scheme → Edit Scheme, and change the Build Configuration in Run tab from "Debug" to "Release".

Please check the official doc and the issue here:

https://facebook.github.io/react-native/docs/running-on-device.html

https://github.com/facebook/react-native/issues/12022

Problem

I've written a simple app for my iPhone that calls an API a dozen times (I'm using async/await for each) for public transportation stop predictions, and then assembles it into a page. The app loads and displays without quickly on Wifi. However, on a robust LTE connection, it displays strange behavior: - It gets stuck on the default "App name - Powered by React Native" splash screen - You can see the rendered view only if you double-tap on the home button and view the app in the app chooser - If you then choose the app, the properly rendered view shows but the app freezes (the home button is unresponsive to clicks) and then after 5 secs or so the app crashes It does not appear to be related to the fact that LTE is a bit slower than my Wifi. The API payloads are small, and the LTE is pretty robust (tried in a few different locations; it was fast). The entire `index.ios.js` is available here: https://github.com/jasonmenayan/Muni/blob/master/index.ios.js

Original source