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.
5
Answers
Got the same issue, XCode 14.3 is the issue! Downgrade to 14.2 and it will work. https://developer.apple.com/download/all/?q=14.2
https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1480802886
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}")"
I use ionic capacitor. I was facing the same issues with MacBook M1 Pro and Xcode 14.3. I downgraded Xcode to 14.2 but it slowed down the build process.
Then I reinstalled 14.3 and replaced:
With:
And it works. Remember to do this only before doing the Archive.
Since changing the generated files are hard, I wrote a post_install script that does the same workaround mentioned above by others. target name depends on your project such as "App".
In your Podfile, (ios/App/Podfile) you can add this.