今天把Xcode13.4升级到了14.3版本后,同一个项目打包上传AppStore包时报错,Archive Failed。报错如下:
报错内容:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/chenrenmu/Library/Developer/Xcode/DerivedData/RMLegalServices-ccguamfkorayxwaeaaqygluqdpjl/Build/Intermediates.noindex/ArchiveIntermediates/RMLegalServices/IntermediateBuildFilesPath/RMLegalServices.build/Release-iphoneos/RMLegalServices.build/Script-522173CC7F853CDB0A23BD28.sh (in target 'RMLegalServices' from project 'RMLegalServices')
cd /Users/chenrenmu/Downloads/Yifatong1.0
/bin/sh -c /Users/chenrenmu/Library/Developer/Xcode/DerivedData/RMLegalServices-ccguamfkorayxwaeaaqygluqdpjl/Build/Intermediates.noindex/ArchiveIntermediates/RMLegalServices/IntermediateBuildFilesPath/RMLegalServices.build/Release-iphoneos/RMLegalServices.build/Script-522173CC7F853CDB0A23BD28.sh
mkdir -p /Users/chenrenmu/Library/Developer/Xcode/DerivedData/RMLegalServices-ccguamfkorayxwaeaaqygluqdpjl/Build/Intermediates.noindex/ArchiveIntermediates/RMLegalServices/BuildProductsPath/Release-iphoneos/RMLegalServices.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/chenrenmu/Library/Developer/Xcode/DerivedData/RMLegalServices-ccguamfkorayxwaeaaqygluqdpjl/Build/Intermediates.noindex/ArchiveIntermediates/RMLegalServices/InstallationBuildProductsLocation/Applications/RMLegalServices.app/Frameworks"
building file list ... rsync: link_stat "/Users/chenrenmu/Downloads/Yifatong1.0/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.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
解决方案:
找到项目所在路径/Pods/Target Support Files/Pos-xxAPP/Pods-xxAPP-frameworks.sh文件,替换
source="{source}")"
为
source="{source}")"
修改后,再次archieve就可以成功了。
参考github:https://github.com/CocoaPods/CocoaPods/issues/11808