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

XCode 16找不到Allow Non-modular Includes设置,配置后问题仍存在

Xcode 16找不到「Allow Non-modular Includes in Framework Modules」及设置无效的解决办法

找到隐藏的设置项

Xcode 16默认隐藏了这个可视化选项,直接搜编译标志就能定位:

  • 打开Build Settings面板,点击右上角搜索框
  • 输入CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES,找到对应项后将值设为YES

修正Podfile配置(Flutter项目)

你当前的全局设置可能没覆盖到关键的Firebase相关target,换用更精准的配置:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    
    # 只针对Firebase及依赖的核心target设置
    if target.name.match?(/Firebase|GoogleUtilities|GTMSessionFetcher/)
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
        # 补加常用兼容设置
        config.build_settings['ENABLE_BITCODE'] = 'NO'
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      end
    end
  end
end

彻底清理缓存(必做步骤)

执行以下命令清空所有缓存后重新构建:

flutter clean
rm -rf ios/Pods ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios && pod install && cd ..

额外排查点

  • 确认Flutter和Firebase Flutter插件是最新稳定版,版本不兼容也会导致设置失效
  • 检查具体target的Build Settings,确保该选项没有被父级配置或其他脚本覆盖为NO

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.18 04:27:04