I’m running into an issue where every time I create a new React Native project using react-native init ProjectName
, then run npx pod-install
followed by react-native run-ios
, I get a build error. This happens consistently with every new project I set up, and I’m not sure if I need to update something to resolve it.
The error seems to be connected to FlipperKit
, and there are multiple warnings related to deployment targets, duplicate build files, and unsupported architecture types. Even though this process used to work smoothly before, it recently started failing. Interestingly, if I open the project in Xcode and run it from there, the app works fine. Any ideas on what might be causing this or how to fix it?
The Problem:
When building from Xcode I got this issue:
Command PhaseScriptExecution failed with a nonzero exit code
Expanding the error you see a ton of logs:
paths, targets, and parameters as per your project setup.
codeCompileC /path/to/DerivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/x86_64/FlipperClient.o /path/to/project/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperClient.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'FlipperKit' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')
cd /path/to/project/ios/Pods
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-ios10.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu++14 -stdlib=libc++ -fobjc-arc -fmodules -fmodules-cache-path=/path/to/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/path/to/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=FlipperKit -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -DPOD_CONFIGURATION_DEBUG=1 -DDEBUG=1 -DCOCOAPODS=1 -DFB_SONARKIT_ENABLED=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /path/to/DerivedData/Index/DataStore -I/path/to/DerivedData/Build/Products/Debug-iphonesimulator/FlipperKit/include -I/path/to/project/ios/Pods/Headers/Private -I/path/to/project/ios/Pods/Headers/Private/FlipperKit -I/path/to/project/ios/Pods/Headers/Public -I/path/to/project/ios/Pods/Headers/Public/Flipper-DoubleConversion -I/path/to/project/ios/Pods/Headers/Public/Flipper-Folly -I/path/to/project/ios/Pods/Headers/Public/Flipper-Glog -I/path/to/project/ios/Pods/Headers/Public/Flipper-PeerTalk -I/path/to/project/ios/Pods/Headers/Public/Flipper-RSocket -I/path/to/project/ios/Pods/Headers/Public/FlipperKit -I/path/to/project/ios/Pods/Headers/Public/Yoga -I/path/to/project/ios/Pods/FlipperKit/iOS/FlipperKit -include /path/to/project/ios/Pods/Target\ Support\ Files/FlipperKit/FlipperKit-prefix.pch -MMD -MT dependencies -MF /path/to/DerivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/x86_64/FlipperClient.d --serialize-diagnostics /path/to/DerivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/x86_64/FlipperClient.dia -c /path/to/project/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperClient.mm -o /path/to/DerivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/x86_64/FlipperClient.o
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'YogaKit' from project 'Pods')
warning: no rule to process file '/Users/chaudhrytalha/Documents/xCodeProjects/Learning React Native/testapp/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/chaudhrytalha/Documents/xCodeProjects/Learning React Native/testapp/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/chaudhrytalha/Documents/xCodeProjects/Learning React Native/testapp/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: Skipping duplicate build file in Compile Sources build phase: /Users/chaudhrytalha/Documents/xCodeProjects/Learning React Native/testapp/node_modules/react-native/React/FBReactNativeSpec/Native/testapp/node_modules/react-native/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm (in target 'FBReactNativeSpec' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase: /Users/chaudhrytalha/Documents/xCodeProjects/Learning React Native/testapp/node_modules/react-native/React/FBReactNativeSpec/Native/testapp/node_modules/react-native/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h (in target 'FBReactNativeSpec' from project 'Pods')
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User] Generate Specs /Users/chaudhrytalha/Library/Developer/Xcode/DerivedData/testapp-fdikhqqgempmsagsnliemealffwv/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-6B583FC85C8A2C3CF6842DBACCA71427.sh
To resolve the build issues and warnings you provided, here’s a breakdown of common issues and solutions:
Deployment Target Warning:
- Warning:
"The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99."
Solution: Update the deployment target for each affected dependency in the Podfile
. Set the minimum supported deployment target to 9.0 or higher.
code# In your Podfile
platform :ios, '9.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
After modifying the Podfile
, run:
codepod install
“No Rule to Process File” Warning:
- Warnings related to files like
README.md
andCMakeLists.txt
not being processed.
Solution: These warnings often appear because non-source files (like markdown and text files) are included in the build phases by mistake. To fix this, adjust the settings in your Xcode
project to ensure only necessary source files are included.
- In Xcode, go to Build Phases of the affected target (e.g.,
Flipper-RSocket
). - Under Compile Sources or Copy Bundle Resources, remove any non-source files (e.g.,
.md
or.txt
files).
Duplicate Build File Warnings:
- Warnings about duplicate build files, like: code
warning: Skipping duplicate build file in Compile Sources build phase: /path/to/FBReactNativeSpec-generated.mm
Solution: These warnings indicate that the same file is listed multiple times in the build phases. In Xcode:
- Go to the Build Phases tab for the target (
FBReactNativeSpec
in this case). - Check both Compile Sources and Copy Headers for duplicate entries.
- Remove duplicate references.
Failed Build Command (PhaseScriptExecution
):
- Failure due to
[CP-User] Generate Specs
script.
Solution: This issue could be due to missing configurations or permissions for running custom scripts in the Podfile
. Check that your script permissions are correct and that the pods
are up-to-date.
If updating and cleaning doesn’t resolve it:
- Run
pod deintegrate
to completely remove the current pod installations. - Run
pod install
again to reinstall them.
Full Clean and Rebuild:
After making the above changes, do a full clean and rebuild to apply all the fixes:
- Close Xcode and clear derived data: code
rm -rf ~/Library/Developer/Xcode/DerivedData
- Reopen Xcode, and Clean Build Folder (Shift + Command + K).
- Run the project.
This should resolve most warnings and errors related to deployment target settings, file processing, duplicate files, and phase script issues. Let me know if any specific issues remain after these steps.
Final Thoughts:
These warnings and build issues in Xcode projects, especially when working with third-party libraries like Flipper and React Native, are common but resolvable. Updating deployment targets, cleaning up unnecessary files from build phases, and ensuring dependencies are correctly configured in your Podfile
can greatly reduce such issues.
After applying the fixes, always remember to clean the build folder and clear derived data to ensure that all changes take effect. This process can seem tedious, but maintaining a clean and updated project setup prevents future build problems and keeps your development environment stable. Following these steps should enable a smoother and error-free build experience going forward.