Xcode 常见错误

1. Xcode 15 编译出现以下错误

clang: error: SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target

从错误信息来看,是指定的文件夹缺失文件导致的,Xcode 14.3 之后已经移除了这个文件。如果 Cocoapod 工程的 iOS 的部署目标 (iOS deployment target) 版本设置为大于等于 13.0,则不会出现这个错误。

综上解决办法有两种:

一是把工程的目标版本都设置为 iOS 13.0,包括 Cocoapod 工程。如果之后更新依赖,则需重新设置。通过设置所有 Cocoapod 的目标版本,或者在 podfile 添加如下代码,指定目标版本:

bash 复制代码
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
    end
  end
end

二是从旧的 Xcode 安装目录下复制一份 arc 文件夹到错误中显示的目录中。Github 上也有该文件GitHub - kamyarelyasi/Libarclite-Files: Missing files in Xcode 14.3

2. pod 安装出现错误

! Could not automatically select an Xcode workspace. Specify one in your Podfile like so:

我这里遇到的是,podfile 里面有多个 target 的时候,需要指定 workspace

3. 模拟器运行 出错

Could not find module 'xxxxxx' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator

需要设置 Excluded Architectures 添加模拟器 Any iOS Simulator SDK: arm64 即可

相关推荐
CocoaKier5 小时前
喜大普奔!2027年春季起,iOS提审最低支持iOS15.0以上
ios·apple
初级代码游戏8 小时前
iOS开发 Swift 速记2:三种集合类型 Array Set Dictionary
开发语言·ios·swift
凡泰AI12 小时前
APP同时覆盖了iOS、安卓和鸿蒙,如何选择混合开发架构才能减少重复建设,提高功能上线效率~
android·ios·harmonyos·mpaas·uni·小程序容器
AIsoft_868816 小时前
iPhone录音重点标记:会议录音与重点内容同步保存功能实测
ios·iphone
00后程序员张16 小时前
使用Instruments工具深入分析iOS应用性能与启动时间优化
android·macos·ios·小程序·uni-app·cocoa·iphone
骇客野人18 小时前
IntelliJ IDEA 菜单中英对照
java·ide·intellij-idea
90后的晨仔18 小时前
Xcode 26.6编译 AFNetworking 报错全解:5 种方案从应急到根治
ios
初级代码游戏1 天前
iOS开发 Swift 速记1:变量和基本数据类型
开发语言·ios·swift
for_ever_love__1 天前
iOS:网络请求再学习
网络·学习·ios·objective-c
不喝水的鱼儿2 天前
本地部署 260K 上下文 Qwen-3.6-35B-A3B 与 Ornith-1.0-35B 模型及 VSCode Copilot 参数调优记录
ide·vscode·语言模型·copilot·llama