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 打开,运行! 你会发现,解决❗️

相关推荐
开心猴爷1 小时前
应对iOS审核4.3:可以使用 IpaGuard 来给属性名混淆的技术细节与平衡之道
后端·ios
iOS开发上架哦1 小时前
iOS应用耗电测试:使用Energy Log、Keymob和Instruments进行性能监控与能源消耗分析
后端·ios
_瑞3 小时前
APM_KSCrash 原理
ios
好的佩奇5 小时前
Dart 之类型系统
flutter·dart
茶底世界之下10 小时前
窗光静物一定要更亮吗?用 Awaking 把曝光收回一点
ios
恋猫de小郭11 小时前
Dart 3.15 新特性:this 终于支持类型提升了
android·前端·flutter
ii_best12 小时前
ios手机开发安卓脚本开发软件[按键精灵教程]从「找最小值」到「Boss 最近刷新」再到「屏幕范围极值」
android·ios·智能手机·自动化·按键精灵
茶底世界之下1 天前
林间步道要不要加暗角?用 Awaking 把强度收在20%
前端·ios·图片资源
season_zhu1 天前
Skills For Real Engineers 系列之一:先配好项目,再让 ask-matt 帮我选技能
ios·openai·ai编程
FungLeo1 天前
成为全栈·Flutter App 篇·主题与可访问性:深浅色、大字号和触控体验
flutter·移动开发·深色模式·可访问性·成为全栈·大字号适配