Flutter用Codemagic打iOS包报错cloud_firestore模块未找到如何处理
修复方案
- 第一步:修改Podfile配置
你当前Podfile存在两个问题:- iOS最低版本过低,
cloud_firestore官方要求最低支持iOS 12.0及以上,需要把platform :ios, ’10.0’改为platform :ios, '12.0',注意把中文单引号替换为英文单引号 - 缺失Flutter插件自动引入的配置块,在
use_frameworks!下方添加如下代码:
修改完成后的完整Podfile参考:use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))# Uncomment the next line to define a global platform for your project platform :ios, '12.0' target 'Runner' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) # Pods for Runner end - iOS最低版本过低,
- 第二步:调整代码仓库的忽略配置
把iOS目录下的Pods文件夹、Podfile.lock、Runner.xcworkspace加入.gitignore,不要提交本地Windows环境生成的iOS依赖文件,避免文件兼容问题。 - 第三步:配置Codemagic的前置构建脚本
在Codemagic的构建流程的iOS构建步骤前,添加如下执行命令,让构建机自动生成正确的iOS依赖:flutter pub get cd ios pod deintegrate pod cache clean --all pod install cd .. - 第四步:校验Codemagic构建设置
确认Codemagic的iOS构建配置中,构建使用的是Runner.xcworkspace 而不是Runner.xcodeproj,构建Scheme选择Runner。
内容的提问来源于stack exchange,提问作者mmmm
相关产品推荐
相关产品推荐

