React Native run IOS build failure - ios

I'm new to developing react native apps for iOS. I created a project using react-native init. I have managed to install all the requirements mentioned on that page. However, I ran into an issue while installing cocoa pods, but I installed it with home-brew. But now, I run into this build issue.
I have attached the issue which showed up in the terminal as well as the screenshot of the build error on Xcode. Any help would be appreciated. Thank you.
terminal build fail code
The following build commands failed:
CompileC /Users/ahyanawaz/Library/Developer/Xcode/DerivedData/Store-bekhqxqflgsqtyheijdxkrbwrksk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTDatePickerManager.o /Users/ahyanawaz/Desktop/Store/node_modules/react-native/React/Views/RCTDatePickerManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Xcode build time error
img01
img02

Related

PhaseScriptExecution failed when trying to run React Native app

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.

react-native-webview commands failed to compile, how to fix?

someone has fixed or saw this issue?
I'm using last version of (react-native) and also macOS Catalina.
I did install react-native-webview by yarn and after into the (./ios) folder I had install the pods.
So build failed, after react-native run-ios.
The following build commands failed:
CompileC /Users/mymac/Library/Developer/Xcode/DerivedData/Project-cnketoyhxyitfqbbcdkdvhpuajey/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-webview.build/Objects-normal/x86_64/RNCWebView.o /Users/mymac/Desktop/React/project/node_modules/react-native-webview/apple/RNCWebView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Are you running the latest version of Xcode?
See react-native-webview issue #1399

running command "xcodebuild" exited with error code 65

I have written a project with react-native and it works on Android. Now I want to run it on ios. When I build my project in Xcode it is okay and I have the "Build succeed" message. But when I run the project in my IDE I have the following Error:
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 MyProjectName.xcodeproj
** BUILD FAILED **
The following build commands failed:
myProjectDirectory/ios/build/MyProjectName/Build/Products/Debug-iphonesimulator/ReactNativeNavigationTests.xctest/ReactNativeNavigationTests normal x86_64
(1 failure)
....
I have tried bellow solutions, but none of them worked for me:
1- I removed the build folder from ios and rebuild the project again.
2- I ran "npm dedupe"
3- I built a simple new project and I could see "Welcome to React Native..." page on iphone.Then I installed wix v2 library in this project and I could see the page again. It means my problem is not about xcode version or wix installation steps.
4- I have clean and rebuild my project in xcode.
I searched a lot on the internet. But I couldn't find any helpful solution.
Any suggestion will be helpful.
It seems your tests are failing.
Try to run tests from Xcode and see if they are ok because my bet is they will fail.

Ionic build on iOS returns "BUILD FAILED"

I'm working on Ionic on a Mac machine. I have installed Google Analytics plugin and trying to build project but it is not working.
I am getting following error:
** **BUILD FAILED** **
The following build commands failed:
..../path normal i386
(1 failure)
>Error: Error code 65 for command: xcodebuild with args:
-xcconfig,/Volumes/Workspace/Dev/TestApp/platforms/ios/cordova/build-debug.xcconfig,
-project,TestApp.xcodeproj,
-target,TestApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,build,CONFIGURATION_BUILD_DIR=/Volumes/Workspace/Dev/TestApp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Volumes/Workspace/Dev/TestApp/platforms/ios/build/sharedpch
I have tried with platform removing and add adding but still not got fixed.
How can I solve this issue?
It was an issue due to xcode compatibility of plugin. uninstalling current xcode and installing xcode 7.3.1 solved issue.
Note: It is due to ionic build ios command internally uses xcode command to build project.

Cordova command-line build fails in /tmp on Mac

I get a linker error building a brand-new PhoneGap app from the command line. It creates a bunch of files, and if I open the created .xcodeproj in Xcode, it builds just fine. So what's wrong with my command-line environment?
$ phonegap create /tmp/buildtest-ios
$ cd /tmp/buildtest-ios
$ phonegap -V build ios
[phonegap] detecting iOS SDK environment...
[phonegap] Checking iOS requirements...
[phonegap] using the local environment
[phonegap] compiling iOS...
[phonegap] Generating config.xml from defaults for platform "ios"
[phonegap] Compiling app on platform "ios" via command "/private/tmp/buildtest-ios/platforms/ios/cordova/build"
[error] An error occurred while building the ios project.** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **
The following build commands failed:
Ld /private/tmp/buildtest-ios/platforms/ios/build/emulator/HelloWorld.app/HelloWorld normal i386
(1 failure)
If I run the offending Ld command myself from the command line, I get "file not found". Does that mean the compiler failed and the linker error is just a red herring?
This is PhoneGap 3.3.0-0.18.0 on Mac OS X 10.9. I can create and build an Android app with this installation, no trouble. I get the exact same behavior if I use cordova directly. I've tried it on two Macs with the same symptom.
I finally discovered the answer using the cordova command-line tools. Cordova has a -d flag which is way more verbose than PhoneGap's -V flag. The linker was failing with a bunch of errors like
duplicate symbol _OBJC_METACLASS_$_CDVTimer in:
/private/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
Note that /tmp on Mac is a symlink to /private/tmp, so these are pointing to the same file. No wonder they're duplicate symbols! So why is it trying to include the same file twice?
I tried creating a new test project in an empty folder /private/my-new-tmp2/buildtest-ios. Building it failed with the same error. So apparently something is weird with Cordova's iOS projects and the Ld linker in the /private directory on Mac OS X 10.9, and I'm the only person who's ever tried this. (As I said, building for Android works fine.)
In case someone else ever runs into the same problem, the solution is to build the project in /Users/me/some/directory rather than anywhere in /tmp or /private. Problem solved.
This may be because your framework references are corrupted or point to nowhere. In the left of XCode under 'Frameworks' and 'Resources' try re-adding anything you added yourself. Chances are with Cordova its a plugin SDK you are using that has been updated or deleted.
I had a similar issue while placing my project under /var/www/PROJECT on mac. I was getting the duplicate errors along with "../cordova/build: Command failed with exit code 65".
I was getting the duplicate errors because /var/www/ is also /private/var/www/
Solution was to move my project as described above to /Users/username/some-other-dir/...
I then ran phonegap run ios and all worked!

Resources