CocoaPods 找不到 pod "React/Core" 的兼容版本

Posted

技术标签:

【中文标题】CocoaPods 找不到 pod "React/Core" 的兼容版本【英文标题】:CocoaPods could not find compatible versions for pod "React/Core" 【发布时间】:2020-10-19 23:38:56 【问题描述】:

当我开始 pod install 结果:

[!] CocoaPods 找不到 pod "React/Core" 的兼容版本: 在 Podfile 中: react-native-fetch-blob(来自../node_modules/react-native-fetch-blob)被解析为0.10.6,这取决于 反应/核心

您的所有规范来源都不包含满足依赖关系的规范:React/Core

你有:

输入错误的名称或版本。 未将托管 Podspec 的源代码库添加到您的 Podfile。

我尝试修复 pod repo 更新* + pod 更新 删除 podfile.lock 还是行不通 提前感谢 pod文件是:

platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'delivery_partner' do
  # Pods for delivery_partner
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'




  target 'delivery_partnerTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'delivery_partner-tvOS' do
  # Pods for delivery_partner-tvOS

  target 'delivery_partner-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

package.json 是:

    
  "name": "dry_partner",
  "version": "0.0.1",
  "private": true,
  "scripts": 
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  ,
  "dependencies": 
    "@react-native-community/async-storage": "^1.6.2",
    "@react-native-firebase/analytics": "^6.0.0-alpha.25",
    "@react-native-firebase/app": "^7.3.1",
    "@react-native-firebase/auth": "^8.0.8",
    "@react-native-firebase/firestore": "^7.2.2",
    "@react-native-firebase/messaging": "^7.1.5",
    "@react-navigation/native": "^5.5.1",
    "add": "^2.0.6",
    "axios": "^0.19.0",
    "firebase": "^7.1.0",
    "lottie-react-native": "^3.2.1",
    "moment": "^2.24.0",
    "native-base": "^2.13.8",
    "react": "16.9.0",
    "react-native": "0.61.1",
    "react-native-confirmation-code-input": "^1.0.4",
    "react-native-dialog": "^5.6.0",
    "react-native-elements": "^1.2.3",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-firebase": "^5.5.6",
    "react-native-gesture-handler": "^1.4.1",
    "react-native-image-picker": "^2.3.1",
    "react-native-loading-spinner-overlay": "^1.0.1",
    "react-native-paper": "^2.16.0",
    "react-native-progress-circle": "^2.0.1",
    "react-native-screens": "^2.8.0",
    "react-native-scrollable-tab-view-forked": "^1.0.9",
    "react-native-snackbar": "^2.0.2",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^4.0.10",
    "react-navigation-material-bottom-tabs": "^2.1.2",
    "react-navigation-stack": "^1.9.3",
    "react-navigation-transitions": "^1.0.12",
    "react-redux": "^7.1.1",
    "redux": "^4.0.4",
    "yarn": "^1.22.4"
  ,
  "devDependencies": 
    "@babel/core": "7.6.2",
    "@babel/runtime": "7.6.2",
    "@react-native-community/eslint-config": "0.0.3",
    "babel-jest": "24.9.0",
    "eslint": "6.5.0",
    "jest": "24.9.0",
    "jetifier": "^1.6.6",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.9.0"
  ,
  "jest": 
    "preset": "react-native"
  

【问题讨论】:

【参考方案1】:

1- 我换行 在包文件中

"@react-native-firebase/analytics": "^6.0.0-alpha.25"

"@react-native-firebase/analytics": "^6.13.0-alpha.25"

2-cd iOS

3- pod 更新

一切正常

谢谢

【讨论】:

【参考方案2】:

转到./node-module/react-native-fetch-blob/react-native-fetch-blob.podspec 并更改

s.dependency 'React/Core'

s.dependency 'React-Core'

希望这对您有所帮助。如有疑问,请随意。

所有学分都转到:https://***.com/a/60130581/8715452

【讨论】:

【参考方案3】:

我正在使用rn-fetch-blob(它取代了react-native-fetch-blob repo)并且需要从 v. 0.10.15 --> 0.10.16 通过

npm i --save rn-fetch-blob@0.10.16

由于将 RN 从 0.59.9 升级到 0.60.6,我需要这样做。为我工作!

【讨论】:

【参考方案4】:

此命令将解决问题在项目的根目录中运行此命令,它将在所有 npm 模块中将“React/Core”替换为“React-Core”:

grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

【讨论】:

【参考方案5】:

只需转到 ./node-module/react-native-fetch-blob/react-native-fetch-blob.podspec 并更改

s.dependency 'React/Core'改成s.dependency 'React-Core'

【讨论】:

以上是关于CocoaPods 找不到 pod "React/Core" 的兼容版本的主要内容,如果未能解决你的问题,请参考以下文章

CocoaPods 找不到 pod“Capacitor”的兼容版本

Flutter:CocoaPods 找不到 pod“Firebase/Messaging”的兼容版本

CocoaPods 找不到 pod“UMCore”的兼容版本

Flutter CocoaPods 找不到 pod“FirebaseCore”的兼容版本

pod 安装时出现 Flutter 错误:CocoaPods 找不到 pod“Firebase/CoreOnly”的兼容版本

CocoaPods 找不到 pod“FirebaseCore”的兼容版本:在快照中 (Podfile.lock)