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

后端 未结 15 2079
南笙
南笙 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 02:07

    I am facing same issue when I upload release on TestFlight, so what I did is

    react-native link react-native-splash-screen
    

    because some how my splash screen plugin is unlinked. This works for me.

    0 讨论(0)
  • 2021-02-01 02:09

    For me I am using firebase framework on my project. I forgot the add GoogleService-Info.plist file to my xcode project. After add it problem gone away.

    0 讨论(0)
  • 2021-02-01 02:10

    This issue could raise due to the following possibilities:

    1. Your run schema set to release instead of debug, so always expect to load main.jsbundle, instead of running from the debug server. Change it by Product->Schema-> Edit Schema->Run-> Build Configuration: Debug

    Check on Xcode log that any message like NSURLConnection finished with error - code -1004 or NSURLConnection finished with error - code -1022. Go to Project->Target->Build Phases-> + -> New Run Script Phase

    1. (-1004) You have configured your XCode project from sketch and forgot to enter the react-native xcode script on Build Phases:

    For the below version of React Native 50: export NODE_BINARY=node ../node_modules/react-native/packager/react-native-xcode.sh

    For the higher version of React Native 50: export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh

    1. (-1022) Your app ATS issue, check on Info.plist, and you can turn off ATS using below code: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
    0 讨论(0)
  • 2021-02-01 02:13

    I faced this issue where I was react-native-splash-screen. After removing it, it is working

    0 讨论(0)
  • 2021-02-01 02:14

    Best check with all outgoing calls. This might happened if you do call an http request to fetch user for example or during fetching user from storage.

    If this call returned error, you'll be stuck in Splash screen.

    Additionally, imagine that you have navigation that uses these calls it will be worse.

    0 讨论(0)
  • 2021-02-01 02:14

    Yep I had WiFi on my phone disabled. Enabled WiFi and boom back in business

    0 讨论(0)
提交回复
热议问题