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

更新cordova-plugin-firebasex后添加iOS平台遇pod退出码31错误

问题:cordova-plugin-firebasex更新后iOS平台添加失败(退出码31)

问题背景

将cordova-plugin-firebasex从11.0.3-cli版本更新至14.1.0后,执行cordova platform add ios时触发以下错误:

Failed to install 'cordova-plugin-firebasex': Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/mmhayes/Documents/MyQCWeb/MyQC_v6_7/node_modules/cordova-common/src/superspawn.js:136:25)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

环境信息

Cordova -v
11.0.0

Cordova platform ls
Installed platforms:
  ios 6.2.0
Available platforms: 
  android ^10.1.1
  browser ^6.0.0
  electron ^3.0.0
  osx ^6.0.0

Cordova plugin ls
cordova-plugin-firebase-analytics 6.1.0 "FirebaseAnalyticsPlugin"
cordova-plugin-firebase-dynamiclinks 6.1.3 "FirebaseDynamicLinksPlugin"
cordova-plugin-firebasex 14.1.0 "Google Firebase Plugin"

已尝试的无效操作

  • cordova clean
  • 卸载重装cordova-plugin-firebasex:cordova plugin rm cordova-plugin-firebasex → cordova plugin add cordova-plugin-firebasex
  • pod repo update
  • sudo gem install cocoapods

10/25 下午4:22 更新

当前项目Podfile内容

source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
use_frameworks!
target 'My Quickcharge' do
    project 'My Quickcharge.xcodeproj'
    pod 'Firebase/Analytics', '~> 8.8.0'
    pod 'Firebase/DynamicLinks', '~> 8.8.0'
    pod 'Firebase/Core', '9.1.0'
    pod 'Firebase/Auth', '9.1.0'
    pod 'Firebase/Messaging', '9.1.0'
    pod 'Firebase/Performance', '9.1.0'
    pod 'Firebase/RemoteConfig', '9.1.0'
    pod 'Firebase/InAppMessaging', '9.1.0'
    pod 'FirebaseFirestore', :tag => '9.1.0', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git'
    pod 'Firebase/Crashlytics', '9.1.0'
    pod 'Firebase/Functions', '9.1.0'
    pod 'Firebase/Installations', '9.1.0'
    pod 'GoogleSignIn', '6.2.1'
    pod 'GoogleTagManager', '7.4.1'
end

执行pod install --repo-update时的错误

pod install --repo-update
Updating local specs repositories

CocoaPods 1.11.3 is available.
To update use: `gem install cocoapods`

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/DynamicLinks":
  In Podfile:
    Firebase/DynamicLinks (= 6.33.0)

None of your spec sources contain a spec satisfying the dependency: `Firebase/DynamicLinks (= 6.33.0)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

解决方案

  1. 统一Firebase版本:Podfile中同时存在Firebase 8.8.0和9.1.0的依赖,版本不一致会触发冲突。将所有Firebase相关依赖统一为同一版本,例如全部改为9.1.0:

    pod 'Firebase/Analytics', '9.1.0'
    pod 'Firebase/DynamicLinks', '9.1.0'
    
  2. 移除重复插件:cordova-plugin-firebasex本身已集成Analytics和DynamicLinks功能,同时安装独立的cordova-plugin-firebase-analytics、cordova-plugin-firebase-dynamiclinks会导致依赖冲突,执行以下命令卸载:

    cordova plugin rm cordova-plugin-firebase-analytics cordova-plugin-firebase-dynamiclinks
    
  3. 清理重建项目:

    • 移除iOS平台:cordova platform rm ios
    • 清理缓存:cordova clean
    • 更新CocoaPods到最新版本:sudo gem install cocoapods
    • 重新添加iOS平台:cordova platform add ios
  4. 手动修复Podfile(可选):若重新添加平台后依旧存在版本问题,可手动编辑platforms/ios/Podfile,确保所有Firebase依赖版本统一,再执行cd platforms/ios && pod install --repo-update


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 11:15:30