由于手机升级了iOS 16.4,想要真机调试,Xcode 也要升级到 14.3, 于是就升级了一下,结果各种报错。
Run、Build报错
File not found: /Users/johnson/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
由于 Xcode 14开始,增加了最低版本支持 Minimum Deployments 11.0
根据报错内容,所有的pod库也会有相应的最低版本支持问题。
解决方案:在podfile文件中,增加以下内容,重新pod install一下
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
end
至此Run、Build没有问题了,但是打包却发现又报错了... ...
Archive报错
building file list ... rsync: link_stat "/Users/xxx/.../AFNetworking.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
解决方案:
全局搜索
source="$(readlink "${source}")"
替换成下面
source="$(readlink -f "${source}")"
文章引自:
https://cloud.tencent.com/developer/article/2255102
https://www.jianshu.com/p/fb1178645292