Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to build react native project after updating to xcode 11.0

Tags:

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?

like image 927
Ganesh Krishna Avatar asked Sep 23 '19 01:09

Ganesh Krishna


People also ask

Can I use Xcode for React Native?

You will need Node, Watchman, the React Native command line interface, Xcode and CocoaPods. While you can use any editor of your choice to develop your app, you will need to install Xcode in order to set up the necessary tooling to build your React Native app for iOS.

Can React Native run on iOS?

Once you have your React Native project initialized, you can run npx react-native run-ios inside the newly created project directory. If everything is set up correctly, you should see your new app running in the iOS Simulator shortly.

Does React Native support Swift?

The main difference between React Native and Swift is that React Native is best for cross-platform development, while Swift is for building iOS apps. Thus, you may develop an Android application in Java or Kotlin, for example, and choose Swift and Objective-C for iOS only.


1 Answers

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.

like image 171
Alex Bin Zhao Avatar answered Oct 18 '22 08:10

Alex Bin Zhao