/

How to Fix the \"iphoneos cannot be located\" Error in macOS

How to Fix the “iphoneos cannot be located” Error in macOS

In this guide, I will walk you through the steps to solve the confusing React Native error that occurs when trying to install React Native and run a project on iOS.

When I attempted to run the command “pod install” in the project’s ios folder as instructed, I encountered a lengthy error message:

Error Screenshot 1

Error Screenshot 2

From this error, the key issue highlighted was “error: SDK ‘iphoneos’ cannot be located.” This seemed suspicious, prompting me to conduct further research. Fortunately, I found a solution that resolved the problem.

To fix this error, follow these steps:

  1. Open your terminal and run the following command:

    1
    sudo xcode-select --switch /Applications/Xcode.app
  2. Once the command has executed successfully, re-run the command “pod install.”

Once I completed these steps, the “iphoneos cannot be located” error was resolved, allowing me to proceed without any further issues:

Success Screenshot

By following these instructions, you can quickly resolve the “iphoneos cannot be located” error in macOS when working with React Native.

tags: [“React Native”, “iOS”, “macOS”, “error fixing”]