Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native app stuck on splash screen on device but works in simulator

My React Native app works in the XCode simulator with no issues, but when I run in a physical device, my iPhone, there's a problem. The app launches and gets stuck on the React Native splash screen, the after 10-15 seconds the app crashes/closes. What's the cause of this and how can I prevent it?

like image 426
Thomas Charlesworth Avatar asked Feb 20 '17 14:02

Thomas Charlesworth


1 Answers

It seems that I have found the problem. According to https://facebook.github.io/react-native/docs/running-on-device, when you build and run the app on your device, your app will load js files from the packager on your computer, so you can live reload your app. That means your device has to be connected to your computer or has to be in the same wifi network as your computer. If your device can't access the packager, it will stuck on the splash screen and quit.

To run on your device reliably, edit build schema and build release version.

like image 58
Guannan He Avatar answered Oct 08 '22 08:10

Guannan He