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

Xcode构建Flutter 2.5.2项目iOS应用时提示Flutter/Flutter.h未找到

Flutter 2.5.2 iOS构建Flutter/Flutter.h未找到报错解决方案
  • 清理项目缓存并重建依赖
    在项目根目录依次执行命令:
    flutter clean
    flutter pub get
    进入ios目录继续执行:
    pod deintegrate
    rm Podfile.lock
    pod install
    操作完成后务必打开后缀为.xcworkspace的Xcode项目文件进行构建,不要打开.xcodeproj文件
  • 校验框架搜索路径配置
    打开Xcode后选中Runner主项目,进入Build Settings标签页,搜索Framework Search Paths,确认配置项中包含$(PROJECT_DIR)/Flutter,且路径属性设置为递归
  • 修复Flutter iOS引擎文件
    旧版本Flutter偶尔会出现iOS引擎文件拉取不完整的问题,在Flutter安装根目录执行:
    flutter precache --ios
    执行完成后回到项目ios目录重新执行pod install即可
  • 校验Podfile配置
    确认ios目录下的Podfile中已引入Flutter官方podhelper脚本,Flutter 2.5.2版本对应配置为:
    flutter_application_path = '../'
    load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
    
    缺失该配置的话补全后重新执行pod install即可

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.24 13:45:07