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

CocoaPods无法找到兼容的Firebase/Messaging版本问题求助

CocoaPods Firebase/Messaging版本冲突解决

问题详情

执行pod install时出现版本冲突报错:

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

In Podfile:
RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 18.8.0, which depends on
Firebase/Messaging (= 10.20.0)

项目核心依赖:

"dependencies": {
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
    // 其他依赖省略
}

已尝试pod install、pod install --repo-update、pod update FirebaseCoreExtension、pod update Firebase/Messaging及手动修改Podfile.lock,均未解决问题。

解决步骤

1. 统一React Native Firebase包版本

尽管package.json中@react-native-firebase/app和messaging版本标注一致,但缓存可能导致实际安装版本不符,需清理后重装:

# 回到项目根目录
rm -rf node_modules package-lock.json yarn.lock
npm install # 或使用 yarn install,根据你的包管理器选择

2. 彻底清理CocoaPods缓存

进入iOS目录,删除旧的Pod依赖和锁文件:

cd ios
rm -rf Podfile.lock Pods
pod deintegrate
pod repo update

3. 重新执行pod安装

确保Podfile中未手动指定Firebase版本,执行:

pod install

4. 强制更新Firebase相关Pod(若上述步骤无效)

如果冲突仍存在,强制更新所有Firebase相关组件:

pod update Firebase Firebase/Messaging --no-repo-update

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.01 07:36:04