React Native : Sample App crashes after upgrading to Mac 10.12.6 - ios

I recently updated my Mac to OS.12.6 Sierra.
Previously working React Native (nothing fancy just their AwesomeProject sample app) stopped working.
When I run react-native run-ios I am able to launch the simulator the app just appears, and then crashes back to the iphone app screen without any error messages.
I have uninstalled and reinstalled react-native-cli, upgraded brew, watchman and reinstalled node modules..but no luck
Anyone has any pointers on this ?

I was having the same issues too after upgrading to Sierra 10.12.6.
I resolved by running create-react-native-app <folder>
And then I ejected it with yarn run eject
yarn run ios after, and the app seems stable.

I found out the rootcause of the issue.
Looks like this is a bug with the latest version.
Facebook has acknowledged this as a bug.
The workaround is to create the project with an older version like 0.44
https://github.com/facebook/react-native/issues/15770

Related

Big Sur, React Native and launchPackager.command

Since upgrading to macOS Big Sur every time I run an React Native app with npx react-native run-ios it opens the package manager in TextEdit instead of a Terminal.
When running node_modules/react-native/scripts/launchPackager.command manually from Finder or the Terminal it works just fine. The file extensions is mapped to Terminal and I obviously have correct access rights on the file.
I've also removed node_modules and reinstalled them.
The latest beta of Big Sur seems to avoid this problem. Leaving the question here in case anyone else has the same problem with older betas.

Running react-native run-ios is success. but not launch simulator

I've been using ReactNative in Windows. Android is perfect and now it has to build on the iPhone and give ipa to clients.
However, even if you run counter-native run-ios after updating the code yesterday, the app will not be launched on the simulator.
I started a new project because I thought there might be a problem with my project, and then I ran a counter-native run-ios, but I failed.
The terminal is output as a successful build, but there is no response to the simulator.
App is not installed.
Somebody please help me.
react-native version is 0.59.9
Images are run on terminals and simulators.
As in latest react-native version 0.60.0 + they have fixed too many problems which are with integration of latest xCode version.
Please do the following to achieve
Upgrade react-native version to 0.60.0 or +
rm -rf node_modules/&& yarn install && react-native link
cd ios and then pod install
Close the bundle and run(Cmd+ r) from xCode
Well, in my case I was in sudo mode. When I turned it back to normal mode, it showed up on the IOS simulator as an app.

How to fix expo start throwing "Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; dont know what that is"

I am trying to set up a react-native development environment. I would like to set up an iOS emulator (preferably an iPhone 10) to run my app on. I am using a Macbook Pro 2016 running on MacOS 10.14.3. I have installed my react-native app through the command create-react-native-app (running version 2.0.2). I also have installed XCode running version 10.2(10E125). When I scan the QR code that Expo generates and run it on my iPad or my Android device it works just fine, but when I try to load the iOS emulator by pressing i after expo start it returns the error
Trying to open the project in iOS simulator...
Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; don't know what that is.
Simulator not installed. Please visit https://developer.apple.com/xcode/download/ to download Xcode and the iOS simulator. If you already have the latest version of Xcode installed, you may have to run the command `sudo xcode-select -s /Applications/Xcode.app`
I have already tried running the command sudo xcode-select -s /Applications/Xcode.app
I have also tried running the command xcode-select -r
I have also confirmed that in my XCode->Preferences->Locations Command Line Tools is selected as "Xcode 10.2(10E125)"
None of these have worked.
I am expecting that after pressing i after expo start an iOS emulator loads up. Thank you.
-----EDIT-------
After some more research, I found out that running open -a Simulator and then running expo start loads the app on an emulator and works for my purposes. But still if I just run expo start without running open -a Simulator it still gives the same error. I want to ask if this is the best I am going to get?
You might be running an outdated version of Expo. I had this problem when I was download someone's old repo using Expo 27 when Expo 36 came out. After updating to the latest version, it works.
To update packages in your project, npm-check-updates comes in handy.
npm i -g npm-check-updates # installs ncu globally
ncu -u # updates all dependency versions in your local package.json
npm install # updates the packages in node_modules to match
Note: This will update all your dependencies to the latest version. If you don't want to do this, you can find the latest version of expo and change the version in package.json manually.
I ran into the exact same problem all of a sudden. Clicking "Run on iOS Simulator" within the Expo Developer Browser worked 2 days ago but did not work today. Your clue of using open -a Simulator helped me though. I went into Xcode and clicked the Xcode menu > Open Developer Tool > Simulator. This started the Simulator and then I was able to click "Run on iOS Simulator" within the Expo Developer Browser and it worked as expected. If you haven't had the fortune of "Run on iOS Simulator" working, I'm guessing you could just start a simulator, download Expo from the App Store and just use it from there. None of this answers the question as to why the error happens but at least gives a few workarounds for anyone else that might need. All that matters is you get the app running on the Simulator in the end!

Is there a way to run an app on iOS 12.2 with an outdated version of Xcode and macOS?

I'm developing a React Native application that I test and build on a real iPhone 7 using Xcode. However, the iPhone recently automatically updated to iOS 12.2, which requires Xcode version 10.2. The problem is that I can't update Xcode because my Mac is running on High Sierra 10.13.6 and is too old to get the Mojave update (2011).
So the question is: Is there any way I can still use the Mac to run the app on my real device, or am I forced to use the emulators/buy a new Mac from now on? Most importantly, is there I way I can still get the Mojave update on my old Mac?
You can download the support files that you want from this repo
Close your xcode, right click on xcode ->Show Package Contents->Contents->Developer->Platforms->iPhoneOS.platform->DeviceSupport, and unzip your file there.
Restart xcode and voilà, your device is supported.
check this for more info.
There is some trick for you to install Mojavae and so Xcode 10.2.
I hope that can help you, and think to deactivate the auto update.

“An error occurred while trying to run the script.” in the UI Automation instrument?

When I try to run a UI Automation script on iOS 6 with iphone simulator 6.0 I am getting the following error:
"An error occurred while trying to run the script."
Please Help!
While working fine with iphone simulator 5.1 with ios5.
It is a bug in Xcode. Some suggest the following (didn't work for me, no old iOS folder).
Assuming you have the latest iOS, now this would be iOS7, with latest version 7.0.3.
cd ~/Library/Application\ Support/iPhone\ Simulator/
mv 7.0 old7.0
ln -s 7.0.3 7.0
Some people claim this bug is fixed in different versions of Xcode (looks like it is back in Xcode 5.0.2 with Instruments 5.0.1), so you could try the latest Xcode beta or any version that you think worked on your computer (like Xcode 5.0.1 apparently)
What worked for me, however was to plug in a device and run my project on the iPod/iPhone instead of the simulator and it worked perfectly.

Resources