react-native
react-native copied to clipboard
Command PhaseScriptExecution failed with a nonzero exit code - Error when Archive on Xcode 14.3
Description
Hi Guys, I'm trying to perform an archive using 0.71.5 but I'm getting an error.
The error occurs in Build phase "[CP] Embed Pods Frameworks", when he runs the script with:
"${PODS_ROOT}/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh"
React Native Version
0.71.5
Output of npx react-native info
System: OS: macOS 13.3 CPU: (8) arm64 Apple M1 Memory: 79.22 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/leonardo.felipe/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0 System Images: android-32 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.5 => 0.71.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- Create a project in 0.71.5
- Try to perform an archive
- Archive will fail in build phase "[CP] Embed Pods Frameworks"
Snack, code example, screenshot, or link to a repository
Investigating the problem I noticed that the problem occurs in the "Symlinked..." of the script Pods-MyApp-frameworks.sh
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
Workaround is to update all the generated ...-frameworks.sh files to add the -f flag to the call to readlink. In other words, replace source="$(readlink "${source}")" with source="$(readlink -f "${source}")"
The Workaround above was suggested for the issue below and has now been merged into the cocoapods repository. I believe we will need an RC with this FIX pointing to the new version of cocoapods as soon as it is released.
https://github.com/CocoaPods/CocoaPods/issues/11808 https://github.com/CocoaPods/CocoaPods/pull/11828
Having the same issue. Apple M2 Pro, Xcode 14.3.
+1
+1
Facing the same issue.
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
UPDATE adding '-f' on the highlighted line in this file resolved my issue. You can try this

duplicate of https://github.com/facebook/react-native/issues/36739
@kelset I believe that although this question deals with an error in the same build phase, it seems to me that it pertains to different matters.
The patch reported in the problem you cited, does not solve my problem.
I had a very strange issue where the pods frameworks script would fail to copy the framework files when archiving a build (building worked fine).
@kelset can you check again this error? it looks different for me from #36739
re opening - but it looks like it's not a react-native problem, but cocoapods, so not really anything we can do about it https://github.com/CocoaPods/CocoaPods/pull/11828 --- I'll pass it along
While trying to upgrade step by step from 0.69.1 to 0.71.5 step by step I have not gotten fastlane to build the latest week. iOS simulator runs fine.
I have applied the target deployment version patch and set my Gemfile for
gem 'cocoapods', git: 'https://github.com/CocoaPods/CocoaPods.git', branch: 'master'
which resolves to https://github.com/CocoaPods/CocoaPods/commit/3ac99beed81d11a830bdce2fac761a49bae47e83.
Given these changes a clean out and pod-reinstall I'm still seeing symlink issues after running this darling command:
rm -rf ~/Library/Developer/Xcode/DerivedData/ && pod cache clean --all && rm -rf build && cd .. && rm -rf node_modules && npm i && cd ios && pod install; bundle exec fastlane beta config:staging
from the ios folder.
The log output from fastlane is saying:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/stefanwallin/Library/Developer/Xcode/DerivedData/app_name-dndxchzknwcsfobnpspeueibkplb/Build/Intermediates.noindex/ArchiveIntermediates/app_name/IntermediateBuildFilesPath/app_name.build/Release-iphoneos/app_name.build/Script-01409BA429EB16AADA33A048.sh (in target 'app_name' from project 'app_name')
cd /Users/stefanwallin/iteam/app_name_app/app/ios
/bin/sh -c /Users/stefanwallin/Library/Developer/Xcode/DerivedData/app_name-dndxchzknwcsfobnpspeueibkplb/Build/Intermediates.noindex/ArchiveIntermediates/app_name/IntermediateBuildFilesPath/app_name.build/Release-iphoneos/app_name.build/Script-01409BA429EB16AADA33A048.sh
mkdir -p /Users/stefanwallin/Library/Developer/Xcode/DerivedData/app_name-dndxchzknwcsfobnpspeueibkplb/Build/Intermediates.noindex/ArchiveIntermediates/app_name/BuildProductsPath/Release-iphoneos/app_name.app/Frameworks
Symlinked...
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/DoubleConversion.framework" "/Users/stefanwallin/Library/Developer/Xcode/DerivedData/app_name-dndxchzknwcsfobnpspeueibkplb/Build/Intermediates.noindex/ArchiveIntermediates/app_name/InstallationBuildProductsLocation/Applications/app_name.app/Frameworks"
building file list ... rsync: link_stat "/Users/stefanwallin/iteam/app_name_app/app/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/DoubleConversion.framework" failed: No such file or directory (2)
Which to me clearly indicates a still present symlink issue. Are we still convinced this is a cocoapods-issue or how RN uses cocoapods or the script?
I'm happy to move this issue to the cocoapods-repo but it seems to me it might be due to some internal use in DoubleConversion
?
Also, cocoapods does not accept issues with RN/Flutter, as per their new issue template. I am not sure where to start to make this a reproducible issue without RN.
WARNING: Please do not file issues for CocoaPods with projects
that use React Native or Flutter. Please remove React Native or Flutter
in your sample app in order to properly demonstrate an issue with CocoaPods itself.
The integration between CocoaPods and React Native or Flutter
makes it very difficult for us to diagnose and fix issues.
Issues with React Native or Flutter will be closed.
Same issue using flutter
I am also facing the same issue, after updating to the lates XCode V14.3
Also having the same issue when i try to archive my App. After updated Xcode to V14.3
Yes, same issue here after upgrading to Xcode 14.3. Cocoapods is broken in this release. Anyone been able to resolve?
@dacowles I've done as described here and it solved my issue
Same issue. React Native 0.65. The following build commands failed: CompileC /{path}/mobile/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Yoga' from project 'Pods') (1 failure)
check for spaces as you are naming the project folders. Use space alternatives.
This help me to fix the issue. https://developer.apple.com/forums/thread/725230 Please have a look, may be this will help..!
For everyone still having this issue, I recommend to follow the instructions in this link and add a post install script for now.
Hi, anyone are experience these issue?
Processing Info.plist
▸ Running script ‘[CP] Embed Pods Frameworks’
▸ Generating ‘App.app.dSYM’
** ARCHIVE FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/runner/Library/Developer/Xcode/DerivedData/App-azlyibamtvkrbhfwntgmcwffjqtw/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target ‘App’ from project ‘App’)
(1 failure)
@RenzoPH have you tried updating cocoapods to version 1.12.1? Updating to the mentioned version solved all my issues
Fixed this by updating updating node_modules/react-native/scripts/find-node.sh
@ L7
- set -e
+ set +e
P.S. Tried switching node from nvm to brew but that didn't made any difference.
@RenzoPH have you tried updating cocoapods to version 1.12.1? Updating to the mentioned version solved all my issues
Thanks! Worked for me!
Fixed this by updating updating
node_modules/react-native/scripts/find-node.sh
@ L7- set -e + set +e
P.S. Tried switching node from nvm to brew but that didn't made any difference.
God, you saved me!!!!!!!!
I don't have Pods-App-frameworks.sh in my ios project, I am using 0.61.5. Can't update project due to some dependencies.
Please guide
@aurangs7 Have you tried following the instructions here ?
Yes @danidaryaweesh I tried that post_install hook, but I got errors on the pod install.
my versions: react-native 0.61.5 cocoa pod 1.12.1
Fixed this by updating updating
node_modules/react-native/scripts/find-node.sh
@ L7- set -e + set +e
P.S. Tried switching node from nvm to brew but that didn't made any difference.
God, you saved me!!!!!!!!
Tried ^^ this fix, I was not able to find find-node.sh file, but I searched 'set -e' on'ios-configure-glog.sh' file The build was success but app is crashing on launch.
Yes @danidaryaweesh I tried that post_install hook, but I got errors on the pod install.
my versions: react-native 0.61.5 cocoa pod 1.12.1
I did this "Move the project folder in a path with no spaces (i.e. ~/sub folder name/ReactNativeApp won't work till you have spaces in the path, so move in a path like ~/folder/ReactNativeApp)" and then deleted and re-created the project
Hi everyone, I already fixed the issue that I encounter, I tried to upgrade our xCode version to 14.+ and also the macOS-12 to our pipeline.
Fixed this by updating updating
node_modules/react-native/scripts/find-node.sh
@ L7- set -e + set +e
P.S. Tried switching node from nvm to brew but that didn't made any difference.
THANKSSS this is working for me!!
Xcode: 14.2 Cocoapod: 1.12.1