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
相关产品推荐
相关产品推荐

