Flutter项目打包ios, Xcode 发布报错 Module‘flutter barcode_scanner‘not found

报错图片

背景

flutter 开发的 apple app 需要发布新版本,但是最后一哆嗦碰到个报错,这个小问题卡住了我一天,之间的埪就不说了,直接说我是怎么解决的,满满干货

思路

这个报错 涉及到 flutter_barcode_scanner; 所以一开始我一直在更改这个插件的版本上下手,最终失败告终,当我绝望之时,发现这个flutter_barcode_scanner 插件官网的一句话

If your existing ios code is Objective-C then you need to do following.
  1. Create a new flutter project with same name at different location (Don't forget to check Include swift support for iOS code while creating)
  2. Just copy newly created /ios folder from project and replace with existing /ios.
  3. Open ios project in Xcode and set minimum deployment target to 12 and set Swift version to 5.
  4. Run pod install in /ios

Note: If you did any changes in ios part before, you might need to make these configuration again

总的来说就是我用到的插件对应的苹果版本有所改变,这里是要求最低 minimum deployment target 12

详细解决步骤

首先xcode 打开当前的 flutter 项目 ios 包的Runner.xcworkspace 文件(双击即可直接打开到 xcode)

第一步:直接看图
第二步:
第三步:

关于此插件的版本限制应该就解决完了,但是还没结束,更改完上述内容保存或者直接退出 xcode

第四步:

随便打开一个你常用的编译器,打开 flutter 完整项目

删除pubspec.lock文件,依次执行

复制代码
flutter clean     

flutter pub cache repair

flutter pub get      

flutter build ios  
第五步:

等编译成功,再次把项目从 xcode 打开,运行! 你会发现,解决❗️

相关推荐
ujainu44 分钟前
Flutter + OpenHarmony 实现经典打砖块游戏开发实战—— 物理反弹、碰撞检测与关卡系统
flutter·游戏·openharmony·arkanoid·breakout
微祎_1 小时前
构建一个 Flutter 点击速度测试器:深入解析实时交互、性能度量与响应式 UI 设计
flutter·ui·交互
王码码20351 小时前
Flutter for OpenHarmony 实战之基础组件:第二十七篇 BottomSheet — 动态底部弹窗与底部栏菜单
android·flutter·harmonyos
2501_915106321 小时前
app 上架过程,安装包准备、证书与描述文件管理、安装测试、上传
android·ios·小程序·https·uni-app·iphone·webview
2501_915106321 小时前
使用 Sniffmaster TCP 抓包和 Wireshark 网络分析
网络协议·tcp/ip·ios·小程序·uni-app·wireshark·iphone
熊猫钓鱼>_>2 小时前
移动端开发技术选型报告:三足鼎立时代的开发者指南(2026年2月)
android·人工智能·ios·app·鸿蒙·cpu·移动端
ZH15455891312 小时前
Flutter for OpenHarmony Python学习助手实战:Web开发框架应用的实现
python·学习·flutter
晚霞的不甘2 小时前
Flutter for OpenHarmony 构建简洁高效的待办事项应用 实战解析
flutter·ui·前端框架·交互·鸿蒙
百锦再2 小时前
Vue高阶知识:利用 defineModel 特性开发搜索组件组合
前端·vue.js·学习·flutter·typescript·前端框架
廖松洋(Alina)2 小时前
【收尾以及复盘】flutter开发鸿蒙APP之成就徽章页面
flutter·华为·开源·harmonyos·鸿蒙