28

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

mrbenhill
  • 379
  • 4
  • 7
  • Appears to be related to: https://github.com/CocoaPods/CocoaPods/issues/11808 – mrbenhill Mar 31 '23 at 21:25
  • Does this answer your question? [Upgrade from xCode 14.2 to 14.3 PhaseScriptExecution failed with a nonzero exit code](https://stackoverflow.com/questions/75486713/upgrade-from-xcode-14-2-to-14-3-phasescriptexecution-failed-with-a-nonzero-exit) – HangarRash Apr 03 '23 at 02:34

4 Answers4

46

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.

Shamim Hossain
  • 1,690
  • 12
  • 21
20
  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}")"
    
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
marvin
  • 211
  • 1
  • 3
3

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

-1

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

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

baoxu
  • 17
  • 1