react-native: out of box react native 0.71.1 failed run-ios

Description

i created a react native app with npx react-native init, i did not change anything inside the app. however, run-ios command failed for me out of the box

1st time i run it, the run-ios command throws an error:

error Failed to install the app on the device because we couldn't execute the "ios-deploy" command. Please install it by running "npm install -g ios-deploy" and try again.

after i install the ios-deploy, I got this generic error:

info Found Xcode project "reactNative71.xcodeproj"
info Found booted Emily’s MacBook Pro, iPhone 12
info Building (using "xcodebuild -project reactNative71.xcodeproj -configuration Debug -scheme reactNative71 -destination id=5B84EC9C-0F31-5666-B1D7-6FE2FB1A8089")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70. To debug build logs further, consider building your app with Xcode.app, by opening reactNative71.xcodeproj.

Version

0.71.1

Output of npx react-native info

System: OS: macOS 12.6 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 124.93 MB / 64.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.13.0 - ~/.volta/tools/image/node/18.13.0/bin/node Yarn: 1.22.10 - ~/.volta/bin/yarn npm: 8.19.3 - ~/.volta/tools/image/node/18.13.0/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.1 => 0.71.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  • create a react native app using npx react-native init
  • run npm run ios

Snack, code example, screenshot, or link to a repository

Screen Shot 2023-01-20 at 5 48 13 PM

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 15
  • Comments: 35 (1 by maintainers)

Most upvoted comments

@tatetoussaint In the end, i am able to run this command. a couple of issues i ran into:

  1. pod install failed due to an incompatible ruby version. however, i upgrade ruby using rbenv: https://github.com/rbenv/rbenv.
  2. out of box, i still got the error:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
                { id:5B84EC9C-0F31-5666-B1D7-6FE2FB1A8089 }

however, i could run the command with udid flag: https://reactnative.dev/docs/running-on-simulator-ios#specifying-an-udid

  • run xcrun simctl list
  • pick a simulator from the list and pass the id as a flag. run command npm run ios --udid=... or npx react-native run-ios --udid=..

As this is a top result for this error, it may be worth noting - this error can also appear if you’re trying to load a simulator with a real device plugged in. The solution is simply to unplug the real device, run npx react-native clean, and try again.

I was facing this error

info Found Xcode project "awesome01.xcodeproj"
info No booted devices or simulators found. Launching first available simulator...
info Launching iPhone 14 (iOS 16.2)
info Building (using "xcodebuild -project awesome01.xcodeproj -configuration Debug -scheme awesome01 -destination id=CA7852DF-60C4-4082-A18F-C0E5C3426132")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening awesome01.xcodeproj.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project awesome01.xcodeproj -configuration Debug -scheme awesome01 -destination id=CA7852DF-60C4-4082-A18F-C0E5C3426132

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Prepare packages

Computing target dependency graph and provisioning inputs

Create build description
Build description signature: 14483777ac3e8ea378903fccae557efa
Build description path: /Users/arjunmanoj/Library/Developer/Xcode/DerivedData/awesome01-gquomzbplqayfvejjrbvavosvsns/Build/Intermediates.noindex/XCBuildData/14483777ac3e8ea378903fccae557efa-desc.xcbuild

note: Building targets in dependency order
/Users/arjunmanoj/react-native/awesome01/ios/Pods/Target Support Files/Pods-awesome01/Pods-awesome01.debug.xcconfig:1:1: error: unable to open configuration settings file
/Users/arjunmanoj/react-native/awesome01/ios/Pods/Target Support Files/Pods-awesome01/Pods-awesome01.debug.xcconfig:1:1: error: unable to open configuration settings file
/Users/arjunmanoj/react-native/awesome01/ios/Pods/Target Support Files/Pods-awesome01/Pods-awesome01.debug.xcconfig:1:1: error: unable to open configuration settings file
/Users/arjunmanoj/react-native/awesome01/ios/Pods/Target Support Files/Pods-awesome01/Pods-awesome01.debug.xcconfig:1:1: error: unable to open configuration settings file
warning: Unable to read contents of XCFileList '/Target Support Files/Pods-awesome01/Pods-awesome01-frameworks-Debug-output-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
warning: Unable to read contents of XCFileList '/Target Support Files/Pods-awesome01/Pods-awesome01-resources-Debug-output-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'awesome01' from project 'awesome01')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'awesome01' from project 'awesome01')
error: Unable to load contents of file list: '/Target Support Files/Pods-awesome01/Pods-awesome01-frameworks-Debug-input-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
error: Unable to load contents of file list: '/Target Support Files/Pods-awesome01/Pods-awesome01-frameworks-Debug-output-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
warning: Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'awesome01' from project 'awesome01')
error: Unable to load contents of file list: '/Target Support Files/Pods-awesome01/Pods-awesome01-resources-Debug-input-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
error: Unable to load contents of file list: '/Target Support Files/Pods-awesome01/Pods-awesome01-resources-Debug-output-files.xcfilelist' (in target 'awesome01' from project 'awesome01')
warning: Run script build phase '[CP] Copy Pods Resources' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'awesome01' from project 'awesome01')

** BUILD FAILED **


info Run CLI with --verbose flag for more details.

This worked out for me:

cd ios && pod deintegrate

pod install

Then go ahead and rerun your project

I was having this problem when I was trying to run my app in the simulator with this command:

$ npx react-native run-ios --simulator='iPhone 14 Pro'

But I also have an personal device, also an iPhone 14 Pro, that is connected in the same network where I do my development and this iPhone is paired with Xcode through wifi.

This problem was happening around 50% if I tried to run on the simulator, but when I tried to run on a different type of simulator that is different from my real device, like --simulator='iPhone SE', this problem never happens. This problem also didn’t happen when I unpaired my real device from Xcode.

It seems that even though I pass the parameter --simulator, sometimes React Native still tries to run the app on a real device with the same name if it finds one paired in the development computer.

One way to bypass this problem without having to unpair our device, is to use the --udid parameter instead of --simulator.

I encountered this issue after running my app on an actual physical device connected thru USB (I also paired my iPhone 15 with my Macbook). I resolved it by unpairing my physical device in Xcode.

Go to Manage Run Destinations… and unpair your physical device

The same.

Every two months I do a test build of a new version of React Native, and every two months I don’t want to upgrade from version 0.68.5

All build since 0.69 were broken somewhere and you need to spent a lot of time to start using it.

It doesn’t worth it.

Still facing the same issue on 0.71.3, specifying --simulator doesn’t really work for me whereas --udid can launch the desired iOS simulator

ios-deploy already installed if that matters

I encountered this issue after running my app on an actual physical device connected thru USB (I also paired my iPhone 15 with my Macbook). I resolved it by unpairing my physical device in Xcode.

Go to Manage Run Destinations… and unpair your physical device

Exact path to your solution - Product -> Destination -> Manage Run Destinations

why you guys need workaround, as the error shows:

Failed to install the app on the device because we couldn't execute the "ios-deploy" command. Please install it by running "npm install -g ios-deploy" and try again

Just install npm install -g ios-deploy, and try again, it worked for me

This is the workaround that worked to me: yarn ios --udid=8E841B4F-5681-4EDC-87E0-69C8C4B387AE

This issue is still happening on RN 0.71.4 I used npx to create the init template. This is unbelievable. 😓

For me I was upgrading from from 0.69.7 to 0.71.2. I’ve deleted node modules and reinstalled dependencies. Also deleted Pods folder and ran pod install. It got rid of the error.

This is the second Saturday I wasted trying to upgrade from 0.70.6 to 0.71+ (this time 0.71.2). Issue still persists even if I use -udid parameter to specify a device ID because Metro cannot find any connected app after the build. As the OP mentioned, this is not only an upgrade issue but also creating a new RN project gives the same error.

Edit: I’ve been able to resolve the problem Metro doesn’t recognize the device by running the following : adb reverse tcp:8081 tcp:8081

However, “Unable to find a destination matching…” issue when I run “yarn ios” issue is still there

Make sure latest ios-deploy package installed

e.g. npm install -g ios-deploy (add sudo if you need to)

Also check which device it is trying to find. Check if it’s attempting to install on Macbook and not the iphone, which you can resolve by installing to iPhone. Instructions:

  1. xcrun xctrace list devices to get device name
  2. npx react-native run-ios --device {insert device name } device name from list devices. If whitespace in name, you need to escape (perhaps \ )

May need to deintegrate pods and re-install:

cd ios && pod deintegrate

pod install