Command PhaseScriptExecution失败,存档时出现非零退出码



我有我的flutter应用程序,我能够构建它并在我的iphone上运行,但当我试图存档它以上传测试飞行时,我得到这个错误:

PhaseScriptExecution [CP] Embed Pods Frameworks /Users/alingavriliuc/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/alingavriliuc/Documents/mdb-flutter-app/frontend/ios
/bin/sh -c /Users/alingavriliuc/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-AF6B532C04771866E7662848.sh
mkdir -p /Users/alingavriliuc/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/alingavriliuc/Library/Developer/Xcode/DerivedData/Runner-cujzpewjolforngnoxyherjuheln/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks"
building file list ... rsync: link_stat "/Users/alingavriliuc/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

显示最近的问题

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]

形象
Flutter clean  
Pods install --repo-update  
Pods deintegrate

试试这个解决方案(它适用于我):

Cocoapods现在有一个问题,因为Xcode 14.3现在在框架的符号链接中使用相对路径。

等待Cocoapods 1.12.1版本发布,或者在您的Pods-Runner-frameworks.sh文件

中做这个简单的更改你可以找到它的路径:iosPodsTarget Support FilesPods- runner Pods- runner -frameworks.sh">

替换:

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

:

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

**注意-f被添加。

然后你可以存档并上传你的应用。

根据Ali Al-Amrad的建议,我使用命令升级到Cocoapods 1.12.1版本:

sudo gem install cocoapods

然后,我不得不重新安装我的项目pod:

pod deintegrate; pod install

@Ali Al-Armad提供的解决方案非常有效。但是。问题是。每次你都必须手动更改。

在下面添加这个脚本,这样你就不需要每次都修改了。

post_install do |installer|
installer.pods_project.targets.each do |target|
shell_script_path = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"
if File::exists?(shell_script_path)
shell_script_input_lines = File.readlines(shell_script_path)
shell_script_output_lines = shell_script_input_lines.map { |line| line.sub("source="$(readlink "${source}")"", "source="$(readlink -f "${source}")"") }
File.open(shell_script_path, 'w') do |f|
shell_script_output_lines.each do |line|
f.write line
end
end
end
end
end

功劳归于这个