Home > Blockchain >  Issues using run-ios with React Native
Issues using run-ios with React Native

Time:12-04

It seems that once every other week I have the same issue where my React Native project stops building and won't open in Xcode, and I wanted to know what some fixes could be for this. When I try and build in Visual Studio Code the app gets stuck at the ⠇ Building the app message. And when I try opening the workspace in Xcode, Xcode stops responding and it gets stuck on the spinning rainbow wheel. For some reason, npx react-native start works just fine, the issue occurs when using npx react-native run-ios.

When this happens it takes me hours to troubleshoot and I can't find a consistent fix for this issue. Does anyone have experience with this and know a solution?

CodePudding user response:

Here are some potential fixes for issues with running the run-ios command in React Native:

  1. Try clearing the React Native packager cache by running the npx react-native start --reset-cache command and then re-running npx react-native run-ios.
  2. Check for any outdated or conflicting dependencies in your project by running npm outdated and npm ls to see if any packages need to be updated or removed.
  3. If you are using Xcode, try cleaning the build folder by selecting "Product" > "Clean Build Folder" in the Xcode menu and then re-running npx react-native run-ios.
  4. Restart your computer and try running the run-ios command again.
  5. If the issue persists, try uninstalling and re-installing React Native and its dependencies by running npm uninstall -g react-native-cli and then npm install -g react-native-cli.

CodePudding user response:

It appears that the issue results from Xcode's way of handling iCloud files. I was able to resolve the issue by moving my project to a folder that is not in my iCloud Drive.

  • Related