You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 15报错:找不到__ObjC模块及CocoaPods编译设置冲突

问题描述

执行pod install时出现以下警告:

[!] The Runner [Debug] target overrides the ENABLE_BITCODE build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig'. This can lead to problems with the CocoaPods installation

  • Use the $(inherited) flag, or
  • Remove the build settings from the target.

[!] The Runner [Release] target overrides the ENABLE_BITCODE build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig'. This can lead to problems with the CocoaPods installation

  • Use the $(inherited) flag, or
  • Remove the build settings from the target.

[!] The Runner [Profile] target overrides the ENABLE_BITCODE build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig'. This can lead to problems with the CocoaPods installation

  • Use the $(inherited) flag, or
  • Remove the build settings from the target.

之后真机调试时,Xcode抛出错误:no such module '__ObjC'


解决步骤

1. 修复CocoaPods的ENABLE_BITCODE警告

打开Xcode,选中Runner target,按以下操作处理:

  • 切换到Build Settings标签页
  • 在搜索框输入ENABLE_BITCODE
  • 找到对应设置项,给Debug、Release、Profile三个配置的输入框都填入$(inherited)
  • 保存设置后重新执行pod install,警告即可消除

2. 解决no such module '__ObjC'错误

尝试以下操作逐一排查:

  • 清理编译缓存:点击菜单栏Product -> Clean Build Folder(快捷键Cmd+Shift+K)
  • 删除Derived Data:打开Xcode偏好设置(Cmd+,),选择Locations,点击Derived Data旁的箭头,删除当前项目的缓存文件夹
  • 检查Runner target的Build Settings里的Other Swift Flags,确保配置无误,或尝试添加-Xcc -fmodules
  • 重启Xcode后重新编译项目

内容的提问来源于stack exchange,提问作者Aqib shahzad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 14:47:02