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

Flutter iOS构建报错:找不到flutter_image_compress_common框架

解决Flutter iOS构建时找不到flutter_image_compress_common框架的问题

问题重现

调试模式下启动iPhone 15模拟器时,Xcode构建完成后触发链接错误:

Launching lib/main.dart on iPhone 15 in debug mode...
Running pod install...                                             19.3s
Running Xcode  
 └─Compiling, linking and signing...                        13.5s
Xcode build done.                                           435.1s
Failed to build iOS app
Error (Xcode): Framework 'flutter_image_compress_common' not found

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 15.

解决方案

  • 清理项目缓存并重装依赖

    1. 执行Flutter清理:flutter clean
    2. 进入iOS目录:cd ios
    3. 删除Pod锁文件和Pods目录:rm -rf Podfile.lock Pods
    4. 更新Pod仓库并重装:pod install --repo-update
    5. 返回根目录重新构建:cd .. && flutter run
  • 检查并调整依赖版本

    1. 打开项目根目录的pubspec.yaml,查看flutter_image_compress的版本号
    2. 确认版本与当前Flutter SDK兼容,建议替换为最新稳定版,或尝试降级到适配版本
    3. 执行flutter pub get拉取新依赖,再重复上述清理和Pod安装步骤
  • 修复Xcode项目配置

    1. 打开iOS目录下的Runner.xcworkspace
    2. 选中Runner target,进入Build Phases -> Link Binary With Libraries
    3. 若列表中无flutter_image_compress_common,点击+号搜索并添加该框架
    4. 切换到Build Settings,找到Framework Search Paths,确保包含$(inherited)和${PODS_ROOT}/flutter_image_compress_common路径
  • 切换Flutter通道(终极方案)

    1. 切换到稳定通道:flutter channel stable
    2. 升级Flutter到最新稳定版:flutter upgrade
    3. 再次执行清理、依赖拉取和Pod安装流程

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.14 05:12:09