Unable to build react native project after updating to xcode 11.0

Ganesh Krishna picture Ganesh Krishna · Sep 23, 2019 · Viewed 10.4k times · Source

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?

Answer

Alex Bin Zhao picture Alex Bin Zhao · Sep 23, 2019

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.