升级Xcode 14.3后运行App遇模块验证失败及Firebase缺失问题
Xcode 14.3 升级后模块验证失败及Pod模块找不到问题
升级Xcode至14.3版本后,运行App时会触发两类核心报错:
- 模块接口验证失败:
failed to verify module interface of 'projectName' due to the errors above; the textual interface may be broken by project issues or a compiler bug - 模块找不到:
No such module Firebase
注:该问题并非Firebase或特定Pod专属,多个第三方Pod均有用户反馈同类异常。
已尝试但无效的操作
- 将所有Pods更新至最新版本
- 升级Cocoapods到1.12.0版本
- 清理Build文件夹与Derived Data
- 更新CommandLineTools至14E222b版本
- 降级CommandLineTools至Xcode 14.3适配的旧版本14C18
可行解决方案尝试
方案1:关闭Pod的"Build Libraries for Distribution"
- 打开项目中的Pods子项目,定位到报错的Pod目标
- 在Build Settings中搜索
Build Libraries for Distribution,将其值改为NO - 执行
pod install,清理项目后重新构建
方案2:添加Swift编译参数
在主项目的Build Settings中,找到Other Swift Flags,添加以下参数:-Xfrontend -no-clang-module-breadcrumbs
添加完成后清理并重新构建项目。
方案3:彻底重建Pod集成环境
- 删除项目目录下的
Pods文件夹和Podfile.lock文件 - 终端执行命令:
pod deintegrate,彻底移除Pod的集成配置 - 重新执行
pod install生成新的Pods项目,再尝试构建App
方案4:统一Swift版本适配
Xcode 14.3对应Swift 5.8版本,部分旧Pod可能未适配该版本,可在Podfile中统一设置Pods的Swift版本:
在Podfile末尾添加以下代码:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '5.8' end end end
保存后执行pod install,再重新构建项目。
内容的提问来源于stack exchange,提问作者stackich
相关产品推荐
相关产品推荐

