Xcode 14: Rsync "failed: No such file or directory (2)" Error on Archive

7.1k views Asked by At

I am trying to archive my project in Xcode 14.3 and I am receiving a build error during the "Embed Pods Framework" Phase.

rsync: [sender] change_dir "/Users/benjaminhill/src/stagey_producer/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos" failed: No such file or directory (2)

I have tried deleting my podfile.lock, cleaning my build folder, upgrading rsync, restarting xcode. Runs fine in Xcode 13 and the project builds fine in Xcode 14 - just running into problems when Archiving.

Here's the full log:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/benjaminhill/Library/Developer/Xcode/DerivedData/stagey_producer-dzqglqxhgmgoreferuvikcueqhdz/Build/Intermediates.noindex/ArchiveIntermediates/stagey_producer/IntermediateBuildFilesPath/stagey_producer.build/Release-iphoneos/stagey_producer.build/Script-89C3F347056509769E64FEDC.sh (in target 'stagey_producer' from project 'stagey_producer')
    cd /Users/benjaminhill/src/stagey_producer
    /bin/sh -c /Users/benjaminhill/Library/Developer/Xcode/DerivedData/stagey_producer-dzqglqxhgmgoreferuvikcueqhdz/Build/Intermediates.noindex/ArchiveIntermediates/stagey_producer/IntermediateBuildFilesPath/stagey_producer.build/Release-iphoneos/stagey_producer.build/Script-89C3F347056509769E64FEDC.sh

mkdir -p /Users/benjaminhill/Library/Developer/Xcode/DerivedData/stagey_producer-dzqglqxhgmgoreferuvikcueqhdz/Build/Intermediates.noindex/ArchiveIntermediates/stagey_producer/BuildProductsPath/Release-iphoneos/stagey_producer.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/Alamofire.framework" "/Users/benjaminhill/Library/Developer/Xcode/DerivedData/stagey_producer-dzqglqxhgmgoreferuvikcueqhdz/Build/Intermediates.noindex/ArchiveIntermediates/stagey_producer/InstallationBuildProductsLocation/Applications/stagey_producer.app/Frameworks"
sending incremental file list
rsync: [sender] change_dir "/Users/benjaminhill/src/stagey_producer/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos" failed: No such file or directory (2)

sent 19 bytes  received 12 bytes  62.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1356) [sender=3.2.7]
Command PhaseScriptExecution failed with a nonzero exit code

5

There are 5 answers

0
Akbarali Nagalpara On

just update the cocoapod and restart your system after every os Update it is normal to have this kind of error while making archive. I tried update cocoapod and it worked for me

  • open up your terminal and type in the command “sudo gem update cocoapods”
  • Restart system
  • reinstall pods

that's it it will work for you.

0
marvin On
  1. Search the file in the bottom-left corner of Xcode

    Pods-[your project name]-frameworks
    
  2. Search for source="$(readlink "${source}")" and replace it with:

    #    source="$(readlink "${source}")"
    source="$(readlink -f "${source}")"
    
3
Shamim Hossain On

Install the latest version of cocoapods >= 1.12.1

This version has been released with these fixes. Try the following commands to install the latest version.

sudo gem install cocoapods
pod install

If you want to use cococapods version < 1.12.1. You can try the following steps:

  1. Navigate to the Pods/Target Support Files/Pods-ProjectName/ directory
  2. Open the Pods-ProjectName-frameworks.sh file.
  3. Replace line 44 with code "$(readlink "${source}")" with "$(readlink -f "${source}")".

Source: https://github.com/CocoaPods/CocoaPods/pull/11828

Hope it will work.

1
baoxu On

https://github.com/flutter/flutter/issues/123852

if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink -f "${source}")" echo "Linked: ${source}" fi

0
Dr.Drakeson On

There are two steps to solving this Step 1: Navigate to the Pods/Target Support Files/Pods-ProjectName/ directory and open the Pods-ProjectName-frameworks.sh file. Then, replace the string "$(readlink "${source}")" with "$(readlink -f "${source}")"

Step 2: Upgrade all pods libraries with minimum deployments of 8.0 to 11.0