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

Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70. #36857

Closed
namnguyenvan200501 opened this issue Apr 10, 2023 · 13 comments

Comments

@namnguyenvan200501
Copy link

Description

My project not support macOs app but when i run npm build ios, it build on my MacOs. Then it failed:
`info Found Xcode workspace "app.xcworkspace"
info Found booted MacBook Pro, android
info Building (using "xcodebuild -workspace app.xcworkspace -configuration Debug -scheme app -destination id=1054CB39-B940-55B7-8FE0-94C055A44522")
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 app.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace app.xcworkspace -configuration Debug -scheme app -destination id=1054CB39-B940-55B7-8FE0-94C055A44522

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

2023-04-10 10:58:30.194 xcodebuild[89841:4961705] Writing error result bundle to /var/folders/j3/7pvdybj52gxfhhtlfndx5v5c0000gn/T/ResultBundle_2023-10-04_10-58-0030.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:1054CB39-B940-55B7-8FE0-94C055A44522 }

    Available destinations for the "app" scheme:
            { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
            { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
            { platform:iOS Simulator, id:0094C925-C17F-45B4-987F-991ABF2BEDD8, OS:15.5, name:iPad (9th generation) }
            { platform:iOS Simulator, id:7AFA8586-3EFD-4B47-ADFF-90686F069185, OS:16.2, name:iPad (10th generation) }
            { platform:iOS Simulator, id:40A1A60D-E4BB-4AC1-B9A5-6ADC43D25748, OS:15.5, name:iPad Air (5th generation) }
            { platform:iOS Simulator, id:47DA93A9-D57B-4BA0-8704-BF610BECAB4A, OS:16.2, name:iPad Air (5th generation) }
            { platform:iOS Simulator, id:EE8499E2-13AC-44A9-8838-590EE6FFD334, OS:15.5, name:iPad Pro (9.7-inch) }
            { platform:iOS Simulator, id:C1AA8585-24DB-4778-A870-662BDF8B1339, OS:15.5, name:iPad Pro (11-inch) (3rd generation) }
            { platform:iOS Simulator, id:1782D6E2-2C09-42E4-839B-E34A80661DBB, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
            { platform:iOS Simulator, id:70B2FFA1-DE93-4E2E-9967-91A323DE5FF8, OS:15.5, name:iPad Pro (12.9-inch) (5th generation) }
            { platform:iOS Simulator, id:A1B33028-16C4-4D80-89FA-30A4C6BA548D, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
            { platform:iOS Simulator, id:BE65C82A-FD7E-4568-A020-3B464F722104, OS:15.5, name:iPad mini (6th generation) }
            { platform:iOS Simulator, id:B492E97A-0228-4A33-9388-97B63D0284C5, OS:16.2, name:iPad mini (6th generation) }
            { platform:iOS Simulator, id:25842526-4C53-4178-A4F7-4C240460D40C, OS:16.2, name:iPhone 8 }
            { platform:iOS Simulator, id:E4FC68CC-4E35-4F01-9A61-C1CEEC584363, OS:15.5, name:iPhone 8 Plus }
            { platform:iOS Simulator, id:E1757812-F94A-4E80-A82B-CFCBF1185746, OS:15.5, name:iPhone 13 }
            { platform:iOS Simulator, id:ACC4B8EE-F4B1-4FF2-9C74-598E9035EC87, OS:15.5, name:iPhone 13 Pro }
            { platform:iOS Simulator, id:95DFC634-0A0B-4139-806B-073CADB18573, OS:15.5, name:iPhone 13 Pro Max }
            { platform:iOS Simulator, id:87587B48-0540-451E-A865-96F9268F7A61, OS:15.5, name:iPhone 13 mini }
            { platform:iOS Simulator, id:DD7BD420-A5B0-4460-B182-1667C5BAFE83, OS:16.2, name:iPhone 14 }
            { platform:iOS Simulator, id:4DC8BF0D-8F4A-4384-AF2E-B8E1AECC6059, OS:16.2, name:iPhone 14 Plus }
            { platform:iOS Simulator, id:DF8E18E6-166B-44AC-B76D-B63E0F5D5784, OS:16.2, name:iPhone 14 Pro }
            { platform:iOS Simulator, id:C98FC316-6FBB-4274-87E6-1DEF88D41943, OS:16.2, name:iPhone 14 Pro Max }
            { platform:iOS Simulator, id:054027EF-A605-43A6-BCF9-A5FA512036B4, OS:15.5, name:iPhone SE (3rd generation) }
            { platform:iOS Simulator, id:55BABAB0-72EA-4E5D-B38E-24117B7E3471, OS:16.2, name:iPhone SE (3rd generation) }
            { platform:iOS Simulator, id:8FD5E855-5437-447B-AF37-33B695BCF01D, OS:15.5, name:iPod touch (7th generation) }

    Ineligible destinations for the "app" scheme:
            { platform:iOS, id:50851c834a60b4d18fa02ab4c44dd30c2752370e, name:android, error:The device “android” is not available because it is not executable. Please ensure that the device is attached and that it is ready to be connected to Xcode. }`

When i run it on another Mac, it doesn't happen

React Native Version

0.71.4

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 13.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 613.76 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.8.1 - /usr/local/bin/node
Yarn: 1.22.19 - ~/Desktop/Spa-React/node_modules/.bin/yarn
npm: 9.5.1 - /usr/local/bin/npm
Watchman: 2023.03.27.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.12.0 - /Users/tcom-mobile/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 33, 33
Build Tools: 30.0.3, 33.0.0, 33.0.2
System Images: android-31 | Google APIs Intel x86_64 Atom, android-33 | Google TV ARM 64 v8a, android-33 | Google APIs Intel x86_64 Atom, android-33 | Google Play Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.18 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.4 => 0.71.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

npm run ios

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

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70.

@github-actions
Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@github-actions github-actions bot added the Platform: iOS iOS applications. label Apr 10, 2023
@brandon-austin-lark
Copy link

Did you find a fix for this?

@MariusCatanoiu
Copy link

same here on 0.72.5. it works building from xcode on debug mode. but not from VSC

@FabianDean
Copy link

same here on 0.72.5. it works building from xcode on debug mode. but not from VSC

Yup, Xcode build works fine -- CLI is where I run into this problem.

@MariusCatanoiu
Copy link

it works not by adding a mandatory simulator, and mode for debugging
react-native run-ios --simulator=\"iPhone 15\" --mode Debug

@HosamZewain
Copy link

it works not by adding a mandatory simulator, and mode for debugging react-native run-ios --simulator=\"iPhone 15\" --mode Debug

This works for me

@Adnan-Bacic
Copy link
Contributor

i got this error after updating xcode and trying to run the project without installing simulators. so after updating xcode you have to open it and install the updated simulators too.

@ctkcoding
Copy link

@Adnan-Bacic thanks for the tip. I was getting xcodebuild error 70 but downloading the newest iOS simulator in the xcode settings' platform tab fully resolved my build issues

@sasanazizi
Copy link

i got this error after updating xcode and trying to run the project without installing simulators. so after updating xcode you have to open it and install the updated simulators too.

How about us?! who doesn't want to install new simulators and run into the old ones that ran before upgrading xcode?

@Adnan-Bacic
Copy link
Contributor

i got this error after updating xcode and trying to run the project without installing simulators. so after updating xcode you have to open it and install the updated simulators too.

How about us?! who doesn't want to install new simulators and run into the old ones that ran before upgrading xcode?

i dont understand why you wouldt want to install the updated simulators? if you just open xcode it should prompt you automatically to do it. the simulators are a part of xcode so i think it should be normal to install/update them too.

@milon27
Copy link

milon27 commented Nov 7, 2024

it works not by adding a mandatory simulator, and mode for debugging react-native run-ios --simulator=\"iPhone 16\"

this is the actual solution . also I open xcode -> window -> simulator + devices ->
delete all the simulators except one. this way it's easy to pick up when running the app.

@ammonvictor
Copy link

i got this error after updating xcode and trying to run the project without installing simulators. so after updating xcode you have to open it and install the updated simulators too.

How about us?! who doesn't want to install new simulators and run into the old ones that ran before upgrading xcode?

Also ensure developer mode is activated on your device, Setting -> Privacy and Security -> Developer Mode

@microJ
Copy link

microJ commented Dec 6, 2024

I got this error with fresh project with npx [email protected] init MyProjectname --version 0.72.5

My Enviroment Info:

OS: macOS 15.1.1
CPU: (8) arm64 Apple M2
CocoaPods:
    version: 1.15.2
iOS SDK:
    Platforms:
      - iOS 17.5
Xcode:
    version: 16.1/16B40
Ruby:
    version: 2.7.8
npmPackages:
  "@react-native-community/cli": Not Found
  react-native:
    installed: 0.72.5
    wanted: 0.72.5
iOS:
  hermesEnabled: true
  newArchEnabled: false

What My Steps:

  1. install newest simulator 18.1
  2. yarn ios --simulator="iPhone 16"

Then got Error: UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65.

To fix this error, I run:

  1. cd ios && NO_FLIPPER=1 bundle exec pod install,this command disable flipper,other solution
  2. yarn ios --simulator="iPhone 16"

It's works! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests