You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Pipeline中CocoaPods依赖airship_flutter兼容问题求助

解决Azure Pipeline中CocoaPods部署目标不兼容问题

方法1:在Pipeline中添加自动化脚本修改Podfile

直接在Azure Pipeline的iOS构建阶段前,添加脚本任务自动修改Podfile的最低iOS部署目标,匹配airship_flutter的要求。

macOS代理环境(常用)

添加Bash脚本任务,执行以下命令:

# 替换Podfile中的最低iOS版本为插件要求的版本(比如14.0,根据实际需求调整)
sed -i '' 's/platform :ios, .*/platform :ios, '"'14.0'"'/g' ios/Podfile

Windows代理环境

添加PowerShell脚本任务,执行:

(Get-Content ios/Podfile) -replace 'platform :ios, .*', 'platform :ios, ''14.0''' | Set-Content ios/Podfile

方法2:在Podfile中添加post_install钩子强制兼容

如果不想修改项目全局的最低部署目标,可在Podfile末尾添加post_install钩子,单独调整airship_flutter的部署目标,将以下代码提交到代码仓库的Podfile中:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'airship_flutter'
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      end
    end
  end
end

Pipeline执行pod install时会自动应用该配置。

方法3:指定兼容的插件版本

若当前airship_flutter版本要求过高,可在pubspec.yaml中指定适配当前项目部署目标的旧版本,示例:

dependencies:
  airship_flutter: ^4.0.0 # 选择符合需求的兼容版本

注意:需确认旧版本插件的功能是否满足业务需求。

内容的提问来源于stack exchange,提问作者Madhavan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 01:45:14