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
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.
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.
This issue could raise due to the following possibilities:
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: DebugCheck 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
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
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I faced this issue where I was react-native-splash-screen. After removing it, it is working
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.
Yep I had WiFi on my phone disabled. Enabled WiFi and boom back in business