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

Expo SDK 48执行EAS BUILD时遭遇Cocoapods依赖兼容问题

解决Expo SDK48 EAS构建的CocoaPods依赖冲突问题

一、Firebase/Core版本冲突解决

冲突原因

项目同时引入了Expo官方Firebase模块(expo-firebase-analytics)和第三方react-native-firebase模块(@react-native-firebase/analytics等),两者依赖的Firebase iOS SDK版本不一致:

  • expo-firebase-core(关联expo-firebase-analytics)要求Firebase/Core = 9.5.0
  • @react-native-firebase/analytics v10.8.0要求Firebase/Core = 7.6.0

解决方案(二选一)

  1. 统一用Expo官方Firebase套件

    • 删除所有@react-native-firebase/开头的依赖:@react-native-firebase/analytics、@react-native-firebase/app、@react-native-firebase/remote-config、@react-native-firebase/perf
    • 替换为Expo官方对应模块:远程配置用expo-firebase-remote-config,性能监控用expo-firebase-performance
    • 重新执行依赖安装:npm install或yarn install
  2. 统一用react-native-firebase套件

    • 删除expo-firebase-analytics依赖
    • 升级所有@react-native-firebase/模块到与Expo SDK48兼容的版本:SDK48对应RN0.71,需使用@react-native-firebase/* v15.x及以上版本(v10.x仅适配RN0.66左右)
    • 安装升级后的依赖:npm install @react-native-firebase/app@latest @react-native-firebase/analytics@latest ...
    • 配置react-native-firebase对应的Expo config-plugin

二、GoogleMaps版本冲突解决

冲突原因

react-native-maps v1.3.2的依赖存在矛盾:

  • 直接要求GoogleMaps = 7.0.0
  • 依赖的Google-Maps-iOS-Utils = 4.1.0需要的GoogleMaps版本与7.0.0不兼容

解决方案

  1. 优先升级react-native-maps版本

    • 升级到与Expo SDK48兼容的react-native-maps版本(推荐1.8.x及以上),此类版本已修复依赖冲突
    • 执行安装:npm install react-native-maps@latest或指定兼容版本
  2. 临时兼容方案(不推荐)

    • 在package.json的resolutions中强制指定GoogleMaps版本,匹配Google-Maps-iOS-Utils的要求:
      "resolutions": {
        "@expo/config-plugins": "^5.0.",
        "GoogleMaps": "7.4.0"
      }
      
    • 重新安装依赖:npm install

后续操作

调整依赖后,执行以下步骤确保构建正常:

  • 清除依赖缓存:npm cache clean --force或yarn cache clean
  • 删除node_modules和package-lock.json/yarn.lock
  • 重新安装依赖:npm install或yarn install
  • 重新启动EAS构建:eas build --platform ios

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.24 11:52:45