When I tried to build my application on IOS emulator, it shows the following error, I search online and I found it has something to do with Pod, but I didn't get any useful solutions for this.
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory /Users/kai/Library/Developer/Xcode/DerivedData/RADAR_Questionnaire-ewiaqvtxwvvffzdyqzeazoxksrcm/Build/Intermediates.noindex/RADAR\ Questionnaire.build/Debug-iphonesimulator/RADAR\ Questionnaire.build/Script-304B58A110DAC018002A0835.sh (in target 'RADAR Questionnaire' from project 'RADAR Questionnaire')
(1 failure)
xcodebuild: Command failed with exit code 65
By the way, the app can build fine until I upgrade my mac from 11 (Big surf) -> 12 (Monetary ), I am not sure does it have something to do with the upgrade.
Related
I am a newcomer when it comes to React Native. However, when I tried to follow the steps that React Native provided: Environment Setup (I chose to use React Native CLI, Mac and iOS). Everything went fine until I tried to run the command
npx react-native run-ios
This is the error log that I received in the Terminal:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/phillip/Library/Developer/Xcode/DerivedData/myproject-csoqwegnbwhthjczvzcjwqasamef/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00018F30.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
I am using a MacBook Air with
M1 chip
MacOS Monterey
Xcode Version 14.2
node v19.6.0
Metro v0.73.7
I searched for a bunch of solutions, including the node versions, nvm, uninstalling build folder and use pod install, commenting post_install function inside Podfile file, but nothing works so far. I am using Node v19.6.0 and this is my which node output: /Users/username/.nvm/versions/node/v19.6.0/bin/node.
I also tried solutions from this reference: React Native - FBReactNativeSpec Command PhaseScriptExecution failed with a nonzero exit code but nothing has worked
Any help would be appreciated, thank you.
Environment
Mac OS X Version 12.1 (Apple M1 chip)
Xcode Version 13.2.1
Simulator Version 13.2 (972.2)
react-native-cli 7.0.3
node v18.4.0
The Issue
This is my first time working on developing an app using React Native. I am trying to run my React Native project on Xcode's simulator, using npx react-native run-ios. However, I am encountering this error message.
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 MCompass.xcworkspace.
Command line invocation:
/Users/brx/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MCompass.xcworkspace -configuration Debug -scheme MCompass -destination id=DC3C75E6-19FD-4B80-87B1-62BF6404ED20
...
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/brx/src/projects/test/MCompass/ios/build/MCompass.build/Debug-iphonesimulator/MCompass.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'MCompass' from project 'MCompass')
(1 failure)
Between the first error message and ** BUILD FAILED **, there were many lines of output listing exports.
I've installed dependencies using both yarn and npm. I've also looked at several other threads with this same issue, but none of the solutions (such as having only one version of nvm or running react-native upgrade) have been successful. Does anyone have any tips?
I had my root folder name "REACT NATIVE", changing it to "REACT_NATIVE" fixed the error as the folder that contains your react native project cannot contain white spaces.
The second solution would be running Xcode with rosetta. This is only applicable for M1 chip macbooks as there are few times Xcode projects fail because of this reason. Please refer to below link for reference:
https://penny-huang.medium.com/xcode-how-to-run-ios-simulator-on-m1-mac-66101b9fccd8
I am a first timer on KMM and have just created a new KMM application project on Macbook M1 Pro. No code changes, this is just the hello world app that I am using. I have been able to successfully build the project for android platform, and it runs fine on the android emulator. However, when I try to build it for the ios platform, it is failing with the below error message:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':shared'.
> The project must have a target for at least one of the following platforms: ios_simulator_arm64.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 553ms
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Build\ shared /Users/manajit/Projects/Learning/App/KMMExperiment/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-4552119A071AC6BAB7327E6434237EC3.sh (in target 'shared' from project 'Pods')
(1 failure)
Command PhaseScriptExecution failed with a nonzero exit code.
Currently, the base application created by the KMM plugin has commented out support for the ARM simulator because there are some libraries that do not yet support it. This is most likely due to Ktor, which only recently added its support.
Go to shared/build.gradle.kts and uncomment all lines containing iosSimulatorArm64.
I'm developing an APP in React Native and I'm trying to run it in the IOS simulator. I've already tried in Android and the project run without problem, but when I try to run it on XCode Simulator trows the following error:
line 3: ../node_modules/react-native/scripts/react-native-xcode.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
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 IDRUS_RSR.xcworkspace
* BUILD FAILED *
The following build commands failed:
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/juanshallcrass/Documents/IDRUS/idrus-rsr/ios/build/IDRUS_RSR/Build/Intermediates.noindex/IDRUS_RSR.build/Debug-iphonesimulator/IDRUS_RSR.build/Script-00DD1BFF1BD5951E006B06BC.sh
(1 failure)
I've already tried changing the Bundle react Native code and images, to: ../node_modules/react-native/scripts/react-native-xcode.sh but nothing changed.
What can I do?
Looks like your project does not have the right permissions, try reinstalling the node_modules with your current user
The file ../node_modules/react-native/scripts/react-native-xcode.sh is currently throwing a Permission denied Exception
I'm trying to create an example app in PhoneGap and Cordova.
I have an example Hello World, and I want to build for iOS (For Android it works just fine).
I have added the platform, but when I run cordova build ios, I get:
** BUILD FAILED **
The following build commands failed:
CompileAssetCatalog build/emulator/ENM.app ENM/Images.xcassets
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/pablo/Documents/po/enm/ENM/platforms/ios/cordova/build-debug.xcconfig,-project,ENM.xcodeproj,-target,ENM,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,build,CONFIGURATION_BUILD_DIR=/Users/pablo/Documents/po/enm/ENM/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/pablo/Documents/po/enm/ENM/platforms/ios/build/sharedpch
I saw several questions like this, but none of the solutions seem to work for me.