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

后端 未结 15 2112
南笙
南笙 2021-02-01 01:27

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

15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 01:51

    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.

提交回复
热议问题