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

Flutter集成video_editor ^1.4.2插件后iOS应用构建失败求助

问题现象

Flutter项目引入video_editor: ^1.4.2依赖后,iOS端无法正常运行,构建阶段持续失败,报错信息:

Lexical or Preprocessor Issue (Xcode): 'mobileffmpeg/LogDelegate.h' file not found
/Users/baw/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ffmpeg-0.4.2/ios/Classes/EmptyLogDelegate.h:19:9

Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)

已尝试执行flutter clean清理缓存,问题未解决。受项目内部分未适配Flutter 3的依赖限制,暂时无法升级Flutter到3.x版本。
执行flutter doctor无异常,输出如下:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!
修复步骤

报错根因是video_editor依赖的flutter_ffmpeg 0.4.2版本iOS端默认没有指定拉取的ffmpeg子模块,导致头文件缺失。不需要升级Flutter版本,按以下操作即可修复:

  • 打开项目iOS目录下的Podfile文件,在文件最顶部添加配置,指定ffmpeg拉取的包类型:
$ffmpegPackage = "full"

若不需要全量编解码能力,可按需替换为min、audio、video等其他版本,full版本包含所有编解码支持,适配性最高,优先选这个避免后续功能报错。

  • 终端进入项目iOS目录,执行命令重新安装pod依赖:
pod deintegrate
pod install --repo-update
  • 回到项目根目录,重新拉取Flutter依赖:
flutter clean
flutter pub get
  • 重新运行iOS项目即可正常构建。

*补充:如果执行pod install时出现模拟器架构相关报错,可打开Podfile找到post_install代码块,添加模拟器架构排除配置:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
  end
end

保存后重新执行pod安装步骤即可。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.31 23:39:21