Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native app opens and closes quickly after installation on ios simulator

Tags:

I've been developing an App using React Native and when I switched to a Mac environment to set up the configurations for ios, after all the setup has been done, the app opens very quickly and closes after the installation, showing that powered by react native screen. I noticed that in my packager screen, the line from the bundle which shows a progress of how much has been loaded does not appear, as if it has never been loaded. Same thing happens if I try to run the code from Xcode.

Here is the screen I'm talking about, for a test project I started for comparisson purposes:

enter image description here

And here is the same screen for my App, without the progress indicator being displayed:

enter image description here

I tried following some solutions provided by the comunity for similar issues but none of them worked. Note that no error message is displayed in my terminal window, as if the build and installation has been succesfull.

Can someone help me with this one? I've been strugling with this App for quite some time, as react native always seems to crash and display error messages for me. Any help would be much appreciated :)

Edit: forgot to mention that I'm trying to run the app on the simulator since I don't have an actual device.

like image 821
Gabriel Schneider Avatar asked Jan 13 '18 23:01

Gabriel Schneider


2 Answers

Exactly this problem happened to me yesterday when I too installed react-native-firebase. I ran react-native run-ios and the app closed as soon as it opened without any specific errors.

I decided to run the app from Xcode, so I opened the Xcode project. To be more precise I opened the <Project>.xcworkspace because I installed CocoaPods. And there inside the logs I when trying to run the app I found the error. It said that the GoogleService-Info.plist was not found. And as I was looking through the Xcode workspace I did not see the file there, although it existed under /ios/<Project>/ in my IDE (VSCode). So maybe just a syncing problem.

So basically I added the file in Xcode as well, re-run and app was running fine.

Of course, I have no idea if I can find some sort of credible sources about this, but this exact issue happened to me under the exact same circumstances as yours.

like image 171
Andrei Olar Avatar answered Oct 20 '22 14:10

Andrei Olar


Some solutions ...

  • If you are in latest react version then try to downgrade it.
  • Re-start your application and try to run again.
  • Delete node modules folder and run using npm install.
  • Try to open project using XCODE and build through it.

    Most probably the problem is with your react version. Try to downgrade to stable react version and try
like image 39
Akila Devinda Avatar answered Oct 20 '22 16:10

Akila Devinda