更新Carthage遇arm64架构冲突报错,求Xcode14.2解决方案
解决Carthage更新时的arm64架构冲突问题
报错信息
.... have the same architectures (arm64) and can't be in the same fat output file
Building universal frameworks with common architectures is not possible. The device and simulator slices for "XXXX" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
解决方案
这个问题的核心是Xcode 14+版本中,iOS模拟器和真机都支持arm64架构,传统Carthage生成的fat framework无法兼容这种重叠架构,必须改用xcframework格式。按以下步骤操作:
直接使用
--use-xcframeworks参数执行Carthage更新命令:carthage update --use-xcframeworks如果执行后仍有问题,先清理旧构建产物再重试:
- 删除项目根目录下的
Carthage文件夹 - 清理Carthage全局缓存:
carthage cache clean --all - 再次运行带
--use-xcframeworks参数的更新命令
- 删除项目根目录下的
若项目使用
bootstrap初始化依赖,同样需要添加参数:carthage bootstrap --use-xcframeworks辅助配置(可选):在Xcode项目的
Build Settings中,找到Excluded Architectures,针对Any iOS Simulator SDK添加arm64,避免本地编译时的架构冲突。
内容的提问来源于stack exchange,提问作者Developer
相关产品推荐
相关产品推荐

