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

升级Flutter及相关包后遇CocoaPods依赖版本兼容问题

Flutter升级后CocoaPods依赖冲突及iOS平台配置问题解决

问题详情

升级Flutter到最新版本并更新所有包后,出现两个CocoaPods相关错误:

  1. Firebase/Firestore版本不兼容
  2. Runner目标未指定iOS平台版本

错误信息如下:

[!] CocoaPods could not find compatible versions for pod "Firebase/Firestore":
  In snapshot (Podfile.lock):
    Firebase/Firestore (= 8.15.0)

  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 3.4.5, which depends on
      Firebase/Firestore (= 9.4.0)


You have either:
 * changed the constraints of dependency `Firebase/Firestore` inside your development pod `cloud_firestore`.
   You should run `pod update Firebase/Firestore` to apply changes you've made.

[!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile.

相关截图:
Pod文件错误

解决方案

1. 解决Firebase/Firestore版本冲突

  • 打开终端,进入项目的iOS目录:
    cd ios
    
  • 执行指定Pod的更新命令:
    pod update Firebase/Firestore
    
  • 如果上述命令无效,尝试彻底清理后重新安装:
    pod deintegrate
    rm Podfile.lock
    pod install
    

2. 明确指定iOS平台版本

  • 打开项目ios目录下的Podfile文件
  • 在target 'Runner' do代码块之前,添加平台版本指定代码(示例指定为12.0,可根据项目需求调整为更高版本):
    platform :ios, '12.0'
    
  • 保存文件后,回到终端执行:
    pod install
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 14:54:24