Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out of box react native 0.71.1 failed run-ios #35917

Closed
xiongemi opened this issue Jan 20, 2023 · 35 comments
Closed

out of box react native 0.71.1 failed run-ios #35917

xiongemi opened this issue Jan 20, 2023 · 35 comments
Labels
💻CLI Platform: iOS iOS applications. Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library

Comments

@xiongemi
Copy link

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(R) Core(TM) 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

@nvacheishvili
Copy link

I am having the same issue with completely new project without anything inside of it - whats going on??

@AgentGoldPaw
Copy link

I have tried everything.

@tatetoussaint
Copy link

tatetoussaint commented Jan 24, 2023

I am also having the same issue... Any idea how to fix @xiongemi?

@dylan-westbury
Copy link

dylan-westbury commented Jan 25, 2023

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

@tatetoussaint
Copy link

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 \ )

Hi @dylan-westbury , I have reinstalled iOS-deploy many times but still no success resolving the issue. Any other ideas?

@ts-ign0re
Copy link

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.

@xiongemi
Copy link
Author

xiongemi commented Jan 26, 2023

@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=..

@xiongemi xiongemi reopened this Jan 26, 2023
@iamarjun
Copy link

iamarjun commented Jan 29, 2023

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

@simonmasinde
Copy link

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 \ )

This worked but now I have the error, Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70.

@mertafor
Copy link

mertafor commented Feb 4, 2023

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

@JasonOuyang8000
Copy link

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.

@vegidio
Copy link

vegidio commented Feb 20, 2023

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.

@endrits079
Copy link

I started the first time from xcode and then it started working

@ts-ign0re
Copy link

Fixed in the latest version

@mawenlihk
Copy link

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

@mtr1012
Copy link

mtr1012 commented Mar 6, 2023

Still facing the same issue on 0.71.3

@cortinico
Copy link
Contributor

Hi all,
If so, this looks like an issue with the CLI:
Please open an issue against the CLI here:
https://github.com/react-native-community/cli/issues

Commenting here with "Still facing this issue" won't help to fix this sadly. Thank you.

@cortinico cortinico added 💻CLI Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library labels Mar 6, 2023
@roryf
Copy link

roryf commented Mar 8, 2023

For anyone that comes across this because it's matching their host device

info Found Xcode workspace "Project.xcworkspace"
info Found booted Rory’s MacBook Pro, iPhone 14
info Building (using "xcodebuild -workspace Project.xcworkspace -configuration Debug -scheme Project -destination id=C2593057-CAC6-592A-9B21-4AD987771C49")
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 Project.xcworkspace.

Looks to be fixed by react-native-community/cli#1823 which is currently only available in an alpha release

@roryf
Copy link

roryf commented Mar 8, 2023

Should be fixed by react-native-community/cli#1863, assuming that gets merged be great if a new 0.71.x can be released.

@AugustoAleGon
Copy link

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

@Veeeeksi
Copy link

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

Do you still have it? I have the same error too.

@Arnav7501
Copy link

any solution

@kokosky93
Copy link

kokosky93 commented Apr 10, 2023

it doesnt work for me as well... I see white screen once my app launched...

"react-native": "0.71.6"

It doesn't work even on a brand new project XD

@roryf
Copy link

roryf commented Apr 10, 2023

@kokosky93 suspect that's a different issue, problem here (not finding correct simulator) appears fixed for me in 0.71.6

@traviswimer
Copy link

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.

I also experienced this problem with a real device and simulator that were different versions. (real iPhone 7 was plugged in and my command was using --simulator=\"iPhone 14\").

I wasn't upgrading RN, installing pods, or anything like that. The error just suddenly started happening, even after restarting my macbook.

In other words, if you have any iOS device connected when you see this error, that may be the cause.

@alanwong0922
Copy link

I am using the "react-native": "0.71.6", with simulator iPhone 14 pro, iPhone SE ...
IOS version: 16.4

failed to start the application too

success Successfully built the app
2023-04-14 10:36:19.212 xcodebuild[70529:8131596] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
2023-04-14 10:36:28.237 xcodebuild[70529:8131946] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
info Installing "/Users/XXXX/Library/Developer/Xcode/DerivedData/XXXX-fqifmkuydiscurbicexxkljpouid/Build/Products/Debug-iphonesimulator/XXXXX.app on iPhone SE (3rd generation)"
info Launching "www.XXX.XXXX"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
Simulator device returned an error for the requested operation.
The request was denied by service delegate (SBMainWorkspace).
Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "www.XXX.XXXX" failed.
The request was denied by service delegate (SBMainWorkspace).

@wilsolutions
Copy link

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

@maitrungduc1410
Copy link

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

@meatnordrink
Copy link

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.

@fitzyjoe
Copy link

fitzyjoe commented Dec 6, 2023

I can't believe RN is a real way of doing software development! I think our team has spent more time wrestling with this delicate house of cards than doing actual software development! You have to get each tool's exact version just right (and there's seemingly no public list of approved interoperable versions) and when you upgrade your tools the whole house falls down. Projects that are just months (not years) old fail to build regularly.

@traviswimer
Copy link

@fitzyjoe I'm not sure if this is what you mean, but @rnx-kit/align-deps is pretty great for ensuring all your dependencies are compatible with your version of RN.

@fitzyjoe
Copy link

fitzyjoe commented Dec 7, 2023

Thanks for responding @traviswimer. When I run this:

npx @rnx-kit/align-deps --requirements react-native@0.73.0

There is no output. Perhaps my deps are aligned.

Still hosed when it comes to building and running though. What I meant in my message about the tool versions was referring more to the executable tools... node, npm, npx, ruby, rvm, yarn, gem, pod, bundle... and when my project has sat for 4 months and in the meantime I've upgraded MacOS and XCode and brew... and now the project won't build... I've tried to downgrade my tools, and I've tried to upgrade the project with react native upgrade helper. I think there are a lot of other people who are experiencing this nightmare - I find them by searching for the errors I encounter.

This new version of xcode requires targeting iOS >12 but the old project might have been targeting 11. I've tried to update this but pulling on the thread only uncovers more errors.

https://reactnative.dev/docs/environment-setup
Official setup says that macos system ruby (2.6.10) is fine... and I can create a new 0.73.0 react native project just fine... but the same docs for earlier version 0.71 say that I need a ruby version manager and install a later version (2.7.6).
https://reactnative.dev/docs/0.71/environment-setup

@traviswimer
Copy link

@fitzyjoe Is the "rnx-kit" property setup in your package.json with capabilities? Otherwise, I'm not sure why there's no output.

As far as the Ruby issue goes, I think it's probably because of the change explained in this comment.

Basically, they briefly switched to requiring a specific version of Ruby, but it caused problems for a lot of people so now in theory they are supporting a range of versions. I'm not sure how well they actually do that though. It looks like they're running their CI tests on a few different versions in various places. I'd try using 3.2.0 or 2.7.7 if you can.

Personally, I set the ruby version in my Gemfile to a specific version. Then I only use bundle commands (e.g. bundle install, bundle exec pod repo update, bundle exec pod install). This ensures everything is installed for the same version of Ruby.

If you want to set a specific version, I wrote a blog post about the old single-version-of-ruby setup (I should probably update it), but most of it still applies other than the default Gemfile would need updated to set a specific version. The post focuses on a specific error, but it's relevant to Ruby/cocoapods in general.

@deleonjulio
Copy link

deleonjulio commented Dec 28, 2023

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

@KevMac19
Copy link

KevMac19 commented Jan 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻CLI Platform: iOS iOS applications. Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library
Projects
None yet
Development

No branches or pull requests