Unable to build react native project after updating to xcode 11.0 - ios

I have a react native project running on react native version 0.59.8 , and xcode version 10.3. Somehow my xcode got updated to version 11.0 and after that i am unable to build the project using react-native run-ios command.
I have tried cleaning up the build and building again. But that doesn't help.
I am getting the following error:
CoreData: annotation: Failed to load optimized model at path '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPackaging.framework/Versions/A/Resources/XRPackageModel.momd/XRPackageModel 9.0.omo'
error Could not find iPhone X simulator.
How to fix this issue?

Not sure about the first error, but I have same problem for second error error Could not find iPhone X simulatorafter upgrade to XCode 11
Basically I changed the line 53 in the react native project /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js, from simulator.isAvailable !== 'YES' to simulator.isAvailable !== true.
The root cause is new XCode 11 changed the simulator metadata format, and react native findMatchingSimulator method is strongly coupled to the previous format.

I was able to fix the "Could not find iPhone X simulator" error.
These are the steps to fix the above error:
Run the command find . -iname findMatchingSimulator.js to locate findMatchingSimulator.js file.
In this file, Change the code from
if (simulator.availability !== '(available)' && simulator.isAvailable !== 'YES') {
continue;
}
to
if (simulator.availability !== '(available)' && simulator.isAvailable !== true) {
continue;
}
By doing this simulator error is resolved. But Still the other error
CoreData: annotation: Failed to load optimized model at path '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPackaging.framework/Versions/A/Resources/XRPackageModel.momd/XRPackageModel 9.0.omo'
exists, which makes the build to fail. If I install xcode 10.3 and run the command react-native run-ios, it still works.
Hope the issue is clear. Any fixes for this issue which occurs in xcode 11?

Two things:
With Xcode 11, make sure you're using react-native-community/cli version 1.9.8 minimum, as it integrates the fix for Xcode 11 simulators new metadata format:
https://github.com/react-native-community/cli/releases/tag/v1.9.8
Also, the iPhone X simulator is no longer available at least on my end. You can use an iPhone 11 instead :
react-native run-ios --simulator='iPhone 11'

In my case:
react: 16.8.3
react-native: 0.59.9
Xcode: 11.0
Add iPhone X simulator: Open Xcode => Window => Devices and Simulators => Simulators => Press Plus button at the bottom
Install latest version of cocoapods: sudo gem install cocoapods
Re-Install cocoapods in project: Open project folder => ios => delete Podfile.lock, Pods folder, build folder => cd ios && pod install
react-native run-ios Done!

After upgrading my XCode to version 11, in XCode simulators list it only shows ios 13 simulators as available, so we need to add previous version simulators, to do so, in XCode go to preferences -> Components -> and download and install a previous version ios simulator (ios 11.0 in my case), after doing so it must show other simulators in available simulator list. Clear all cache and re-run the react-native run-ios command and it should work now.

Try run specifying simulator version.
react-native run-ios --simulator="iPhone 11 Pro Max"

I upgraded "react-native" to "^0.61.1" and it worked for me

I was having this same issue, and even went back to xCode 10.3....and still had the same issue. Then I came across this https://github.com/react-native-community/cli/pull/414 . Sounded to me like maybe they had fixed the issue and that I was running with an old version of the CLI. Proceeded to delete the entry in my lock file and run npm install. Working now. CLI is up to 1.11.2 https://github.com/react-native-community/cli

Run can run xcrun simctl list devices in a terminal to make sure you have the iPhone X simulator installed. If you can't see it in the list you need to add it to Xcode through Window -> Devices and Simulators -> Simulators (click the + in the bottom left)

Related

Could not find iPhone 6 simulator

enter image description hereWhat I did was, I removed the XCode version 11 on my MAC machine then re-installed version 10.3.
When I run the react-native run-ios and it no longer works. Could not find iPhone 6 simulator
I have followed the solution on the StackOverFlow, replaced the code as below.
if (!version.includes('iOS') && !version.includes('tvOS')) {
Please advise
There are a couple of things that may have happened. The iPhone 6 simulator may no longer be on your hard drive and/or the React tools are unable to locate the simulator.
You can download additional simulators by selecting the Components tab of the XCode preferences window and download the ones you need. Adding Simulators
You can get a list of install simulators using this command:
xcrun simctl list devices
You can also inform the react-native tool to use a different simulator by using the --simulator flag, like this:
react-native run-ios --simulator="iPhone 8"
Hopefully one or more of these steps will help you out!

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.

react-native run-ios fails - Could not find simulator

I am using
react-native-cli: 2.0.1
react-native: 0.55.3
Xcode : 10.2.1
I am trying to get a certain react-native project to build and run for the first time from my system using react-native run-ios.
I get :
Found Xcode workspace App.xcworkspace
Could not find iPhone 6 simulator
I looked for the different answers here but they didn't help me solve my problem (I changed the condition in node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js)
What's the meaning of this error ?
How to get the project to build and run ?
Thanks
Yaron
This happened to me after updating to the latest Xcode.
I went to the Download simulators, chose the newest one, and after it got downloaded and installed, I got back the devices you see in the screenshot

iOS Xcode: Failed to find a suitable device for the type IBSlimDeviceTypeiPdad2x error after updating to Xcode 10.2

I am developing React Native app using react-native-cli.
To run iOS app on device with iOS 12.2 installed i've recently updated my Xcode version to 10.2 and I am facing this error during the compilation:
Also, getting this error, trying to open simulator from Xcode - Open developer tool
What can be the problem?
Xcode 10.2 which contains iOS 12.2 and it's simulators
Please go to Xcode > Preferences > Locations
Select command line tools to latest Xcode.
Hope it will work.
Just run the following command to make sure all background process of the simulator that were run during the update are killed :
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

Xcode device list is empty in ionic/cordova project

No matter what I try I can't get access to the Xcode simulators from my ionic/cordova project. Xcode Command Line Tool is installed.
cordova run ios --list
returns
Available ios devices:
Available ios virtual devices:
ionic cordova emulate ios --list
returns
Available ios virtual devices:
I have all the simulators in Xcode and it's working fine when Im opening the project in Xcode and run the simulators manually.
The consequences of this is that I cant run my app with livereload from the terminal:
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1"
returns
Device id for device name "iPhone X" and runtime "iOS 12.1" could not be found, or is not available.
This is a bug related to the new version of XCode. I had the same problem. I would advise you to uninstall and reinstall XCode but I don't think it will work.
I solved (dirty fix) my problem by applying what ejerskov says here: https://github.com/ios-control/ios-sim/issues/246
On platforms/ios/cordova/node_modules/ios-sim/src/lib.js
I have changed
available_runtimes[ runtime.name ] = (runtime.availability === '(available)');
to
available_runtimes[ runtime.identifier ] = (runtime.availability === '(available)');
Otherwise I think we should wait for a new release of ios-sim and cordova-ios...

Resources