flutter 解决在导入qr_code_scanner依赖包之后,iOS端报错问题

报错信息:

The Swift pod `qr_code_scanner` depends upon `MTBBarcodeScanner`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

翻译过来:

Swift pod“qr_code_scanner”依赖于“MTBBarcodeScanner”,它不定义模块。要选择生成模块映射的目标(当构建为静态库时,从Swift导入它们是必要的),可以设置`use_modular_headers!`在Podfile中全局设置,或者为特定依赖项指定“:modular_headers=>true”。

这样看清晰多了,是在导入qr_code_scanner依赖包之后出现的问题,百度了一下,通过这篇文章找到解决办法,

[BUG] cannot build ios because The Swift pod qr_code_scanner depends upon MTBBarcodeScanner

在target 'Runner' do里面,加两行代码即可。

use_modular_headers! 

use_frameworks! 

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容