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

相关推荐
for_ever_love__5 小时前
UI学习:UISearchController基础了解和应用
学习·ui·ios·objective-c
代码的小搬运工9 小时前
ZARA仿写
ios
用户9655973619010 小时前
Flutter 遇上 FlutterSkills:让开发效率翻倍的实用技巧
flutter
人月神话Lee11 小时前
【图像处理】vImage/Accelerate——SIMD 让 CPU 也能飞
ios·swift·图像识别
2601_9557674215 小时前
iPhone 17 护眼钢化膜怎么选?从PWM频闪到圆偏振光,解析「软硬协同」光学方案
ios·ar·iphone·护眼钢化膜·圆偏振光·#观复盾护景贴·磁控溅射
2501_9197490315 小时前
鸿蒙 Flutter 实战:image_crop 0.4.1 适配 3.27-ohos 全流程
flutter·华为·harmonyos
2601_9557674218 小时前
iPhone 17 护眼保护膜怎么选?圆偏振光 + AR 抗眩方案,解读 96% 透光率与 ≤0.5% 反射率的协同价值
ios·ar·iphone·圆偏振光·#观复盾护景贴·scinique双护技术
三雒18 小时前
KMP 实战:Android 开发如何快速统一双端 IM 模块
android·ios·kotlin
木子雨廷18 小时前
Flutter 内存管理实战:从 GC 原理到 DevTools 泄漏排查
前端·flutter
恋猫de小郭19 小时前
GSY 史上最全跨平台/架构/语言的项目,七大项目召唤「神龙」
android·前端·flutter