更新Xcode版本到14.3后所有项目编译Archive打包报错Command PhaseScriptExecution failed with a nonzero exit code
error below:
Xcode Version 14.3 (14E5207e)
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users//Library/Developer/Xcode/DerivedData//Build/Intermediates.noindex/ArchiveIntermediates/Staging/IntermediateBuildFilesPath/.build/Release-iphoneos/*.build/Script-887C37B6C54D972D35131B16.sh (in target '' from project '**')
/bin/sh -c /Users/***/Library/Developer/Xcode/DerivedData/......./Script-887C37B6C54D972D35131B16.sh
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//Library/Developer/Xcode/DerivedData/-fhmnysqlfziamdezcdnckgrfgtgn/Build/Intermediates.noindex/ArchiveIntermediates/Staging/InstallationBuildProductsLocation/Applications/**.app/Frameworks"
building file list ... rsync: link_stat "/Users/***/***App/iOSRelease/../../../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/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
在网上查了很多资料各种解决办法都有,比如:
1、将 ~/Library/Developer/Xcode/DerivedData/ 目录下的工程缓存删除掉即可,然后重启工程编译。
2、服务器端日志将出现错误提示:
2005/08/23 06:32:01 [8388] secrets file must not be other-accessible (see strict modes option)
2005/08/23 06:32:01 [8388] continuing without secrets file
2005/08/23 06:32:01 [8388] auth failed on module from documentserver
服务器端rsyncd.secrets (用户:密码)<用户必须是系统用户,密码尽量不要为系统用户密码>
客户端rsyncd.secrets (密码)<服务器端密码>
服务器和客户端的帐户密码都不可以有空格,否则会出现
@ERROR: auth failed on module
注意:
如果改变了端口号,一定要在/etc/services中把对应的端口改变才能正常运行
如rsync 873/tcp改成
rsync 3334/tcp即可
我全部都试了一遍,都没有解决问题,最后查阅国外网站发现有我遇到的类似的问题并提供了相应的解决办法
解决方法:
Workaround is to update all the generated ...-frameworks.sh files to add the -f flag to the call to readlink. In other words, replace
source="$(readlink "${source}")"
with
source="$(readlink -f "${source}")"
我尝试了一下,哎!果然有效,只是没有说清楚是什么原因导致的,我猜大概是14.3版本Xcode和cocoapods出现了兼容性问题