Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Archive command fails with Ionic Capacitor and React - Command PhaseScriptExecution failed with a nonzero exit code

For a couple of days, without changing any details on the project, I've been receiving this error during the Xcode publishing phase. I have also shared my code with other developers, and on their computer publishing is not a problem.

Below is the error log:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/[USER_NAME]/Library/Developer/Xcode/DerivedData/App-faqqbffxhfofrrewfezzfuhlylqt/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target 'App' from project 'App')
    cd /Users/[USER_NAME]/Desktop/Workspace/[APP_NAME]/ios/App
    /bin/sh -c /Users/[USER_NAME]/Library/Developer/Xcode/DerivedData/App-faqqbffxhfofrrewfezzfuhlylqt/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh

mkdir -p /Users/[USER_NAME]/Library/Developer/Xcode/DerivedData/App-faqqbffxhfofrrewfezzfuhlylqt/Build/Intermediates.noindex/ArchiveIntermediates/App/BuildProductsPath/Release-iphoneos/App.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/Capacitor.framework" "/Users/[USER_NAME]/Library/Developer/Xcode/DerivedData/App-faqqbffxhfofrrewfezzfuhlylqt/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app/Frameworks"
building file list ... rsync: link_stat "/Users/[USER_NAME]/Desktop/Workspace/[APP_NAME]/ios/App/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Capacitor.framework" failed: No such file or directory (2)
done

sent 29 bytes  received 20 bytes  98.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

Tried to reinstall Capacitor, rebuild the pods, the entire ios folder and project. Also uninstalled and reinstalled Xcode. I'm always stuck at the same point.

like image 621
Federico Giorgio Salani Avatar asked Jan 21 '26 14:01

Federico Giorgio Salani


2 Answers

The answer provided by Baryon Lee worked for me. However for those who are looking for the place where this change has to be applied, you should go to the following path:

/ios/App/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh

And then replace:

source="$(readlink "${source}")"

with:

source="$(readlink -f "${source}")"

like image 169
ebarooni Avatar answered Jan 25 '26 06:01

ebarooni


https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1480802886

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}")"

This is my first time contributing to CocoaPods though, so take it with a grain of salt!

like image 36
Baryon Lee Avatar answered Jan 25 '26 08:01

Baryon Lee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!