1.问题
今天升级了xcode14.3,然后打包flutter和原生混编项目时,出现了如下错误:
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
2.解决
这个错误很奇怪,一开始我以为是flutter的问题,但是直接运行项目是没问题的,打包时才会出现该错误。
顺着flutter的线索去查找,找到了这里,原来不是flutter的问题,是cocoapods的问题,解决办法要么等着cocoapods更新,要么自己解决。
我是自己解决的,只需要进入项目中的这个文件中:
/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh
其中Runner是自己的项目名,修改如下内容
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
修改为:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
增加一个-f即可。再次打包,可以正常打包了。
3.最后附上自己的iOS踩坑总结
iOS踩坑总结,这是我自己的博客,源代码也是开源了的,感兴趣的朋友关注下。