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

iOS执行pod install报错:找不到兼容的react-native-webrtc版本

解决React Native项目iOS端pod install中react-native-webrtc版本兼容问题

你的React Native项目「Speed_Dating」在Android端运行正常,但iOS端执行pod install时出现CocoaPods could not find compatible versions for pod "react-native-webrtc"错误,核心原因是当前安装的react-native-webrtc@1.94.1与项目使用的React Native 0.66.4在iOS端存在版本兼容性冲突。

以下是具体解决步骤:

  • 降级react-native-webrtc到适配RN 0.66.4的版本

    1. 卸载当前版本:
      npm uninstall react-native-webrtc
      
    2. 安装兼容版本(推荐1.89.1,该版本适配RN 0.66.x系列):
      npm install react-native-webrtc@1.89.1
      
    3. 同步类型定义包版本(保持与安装的webrtc版本匹配):
      npm uninstall @types/react-native-webrtc && npm install @types/react-native-webrtc@1.75.5
      
  • 清理iOS端缓存并重新安装Pods

    1. 进入项目iOS目录:
      cd ios
      
    2. 删除旧的Pod锁定文件和Pods文件夹:
      rm -rf Podfile.lock Pods
      
    3. (可选但推荐)删除Xcode衍生数据,避免缓存干扰:
      rm -rf ~/Library/Developer/Xcode/DerivedData
      
    4. 更新CocoaPods仓库索引:
      pod repo update
      
    5. 重新执行Pods安装:
      pod install
      
  • 若上述步骤无效,额外检查:

    • 查看项目iOS目录下的Podfile,确认是否手动添加了react-native-webrtc的版本限制或自定义源,如有则调整为兼容RN 0.66.4的配置
    • 确认Xcode版本为13.x(RN 0.66.4官方推荐版本,同时适配降级后的webrtc版本)

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.24 00:47:53