Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command PhaseScriptExecution failed with a nonzero exit code when archiving

Tags:

xcode

ios

flutter

I have my flutter app, I am able to build it and run on my iphone but when I try to archive it to upload to test flight i get this errors :

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/user/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-AF6B532C04771866E7662848.sh (in target 'Runner' from project 'Runner')
    cd /Users/user/Documents/mdb-flutter-app/frontend/ios
    /bin/sh -c /Users/user/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-AF6B532C04771866E7662848.sh

mkdir -p /Users/user/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.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/openssl_grpc.framework" "/Users/user/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks"
building file list ... rsync: link_stat "/Users/user/Documents/mdb-flutter-app/frontend/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/openssl_grpc.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/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

Showing Recent Issues

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\]

Image

Flutter clean  
Pods install --repo-update  
Pods deintegrate
like image 312
Alin Avatar asked Nov 25 '25 03:11

Alin


1 Answers

Try this solution (it works for me):

There is an issue with Cocoapods now, because Xcode 14.3 is now using a relative path in its symlink for frameworks.

Either wait for release of Cocoapods version 1.12.1 or make this simple change in your Pods-Runner-frameworks.sh file

You can find it on path: "ios\Pods\Target Support Files\Pods-Runner\Pods-Runner-frameworks.sh"

Replace:

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

with:

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

** Note that -f was added.

Then you can archive it and upload your app.

like image 130
Ali Al-Amrad Avatar answered Nov 26 '25 18:11

Ali Al-Amrad