pod install CocoaPods 找不到 pod “React/Core” 的兼容版本

pod install CocoaPods could not find compatible versions for pod "React/Core"

提问人:Emilis Kakanis 提问时间:12/8/2020 更新时间:11/22/2023 访问量:5332

问:

我正在尝试在 iPhone 上启动 react-native 应用程序。现在我正在使用命令 pod install 安装 pod,但它向我抛出错误:

CocoaPods 找不到 pod “React/Core” 的兼容版本: 在 Podfile 中:
react-native-fetch-blob (from ) 解析为 0.10.6, 这取决于 反应/核心
../node_modules/react-native-fetch-blob

您的任何规范源都不包含满足依赖项的规范:。React/Core

您有: * 键入了错误的名称或版本。* 未添加 将 Podspec 托管到 Podfile 的 source 存储库。

Pod 更新无济于事。 更新了一些依赖项 这是我package.json

  "dependencies": {
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/async-storage": "^1.9.0",
    "@react-native-community/cli-platform-android": "^4.13.0",
    "@react-native-community/cli-platform-ios": "^4.13.0",
    "@react-native-community/datetimepicker": "^2.4.3",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/netinfo": "^5.7.0",
    "@react-native-community/picker": "^1.6.6",
    "@react-native-community/toolbar-android": "^0.1.0-rc.2",
    "@react-native-firebase/analytics": "10.1.1",
    "@react-native-firebase/app": "10.1.0",
    "@react-native-firebase/crashlytics": "10.1.1",
    "@twotalltotems/react-native-otp-input": "^1.0.23",
    "adm-zip": "^0.4.13",
    "apisauce": "^1.1.1",
    "base-64": "^0.1.0",
    "geolib": "^3.3.1",
    "instabug-reactnative": "^9.1.1",
    "jail-monkey": "^2.3.3",
    "jetifier": "^1.6.6",
    "lodash.debounce": "^4.0.8",
    "lottie-react-native": "^3.3.2",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.25",
    "plist": "^3.0.1",
    "prop-types": "^15.7.2",
    "ramda": "^0.26.1",
    "react": "16.9.0",
    "react-native": "0.63.2",
    "react-native-background-fetch": "^3.1.0",
    "react-native-background-geolocation": "^3.9.1",
    "react-native-blur-overlay": "^1.0.7",
    "react-native-dash": "^0.0.11",
    "react-native-device-info": "^5.6.1",
    "react-native-easy-toast": "^1.2.0",
    "react-native-elements": "^2.0.0",
    "react-native-exit-app": "^1.1.0",
    "react-native-extended-stylesheet": "^0.11.1",
    "react-native-fbsdk": "^2.0.0",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-flexi-radio-button": "^0.2.2",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-get-music-files": "https://github.com/cinder92/react-native-get-music-files.git",
    "react-native-get-random-values": "^1.3.1",
    "react-native-google-signin": "^1.2.2",
    "react-native-i18n": "^2.0.15",
    "react-native-image-picker": "^2.3.1",
    "react-native-indicators": "^0.17.0",
    "react-native-ionicons": "^4.x",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-localize": "^1.4.2",
    "react-native-maps": "^0.27.1",
    "react-native-modal": "^11.5.6",
    "react-native-modal-datetime-picker": "^8.9.3",
    "react-native-navigation": "^6.7.5",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-picker-select": "^7.0.0",
    "react-native-progress": "^4.1.2",
    "react-native-raw-bottom-sheet": "^2.0.2",
    "react-native-reanimated": "^1.9.0",
    "react-native-render-html": "^4.1.2",
    "react-native-root-toast": "^3.2.0",
    "react-native-send-intent": "^1.0.30",
    "react-native-slider": "^0.11.0",
    "react-native-snap-carousel": "^3.8.4",
    "react-native-ssl-pinning": "^1.5.1",
    "react-native-status-bar-height": "^2.3.1",
    "react-native-swift": "^1.2.2",
    "react-native-switch-pro": "^1.0.4",
    "react-native-tab-view": "^2.14.4",
    "react-native-timer-mixin": "^0.11.0",
    "react-native-track-player": "1.2.3",
    "react-native-vector-icons": "^6.7.0",
    "react-native-view-shot": "^3.1.2",
    "react-native-webview": "^10.10.0",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-actions": "^2.6.5",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.1.3",
    "redux-thunk": "^2.3.0",
    "rn-apple-healthkit": "^0.8.0",
    "rxjs-compat": "^6.5.5",
    "validate.js": "^0.13.1",
    "xcode": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/runtime": "^7.9.2",
    "@react-native-community/eslint-config": "^1.0.0",
    "@types/react-native": "^0.62.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^25.3.0",
    "babel-plugin-module-resolver": "^3.2.0",
    "eslint": "^6.8.0",
    "eslint-config-prettier": "^6.0.0",
    "eslint-config-react-app": "^4.0.1",
    "eslint-config-react-native-prettier": "^1.0.1",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.14.3",
    "eslint-plugin-react-native": "^3.7.0",
    "jest": "^25.3.0",
    "metro": "^0.64.0",
    "metro-config": "^0.64.0",
    "metro-core": "^0.57.0",
    "metro-react-native-babel-preset": "^0.64.0",
    "numeral": "^2.0.6",
    "prettier": "^1.18.2",
    "react-test-renderer": "16.9.0",
    "reactotron-apisauce": "^3.0.0",
    "reactotron-react-native": "^3.6.4",
    "reactotron-redux": "^3.1.1",
    "reactotron-redux-saga": "^4.2.2",
    "stylelint": "^10.0.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  },
  "isSwift": true
}
iOS React-Native Cocoapods

评论

0赞 Meisan Saba 12/8/2020
嗨,先删除文件夹,然后重试。如果也遇到同样的错误,请尝试另一个版本的NodeMudulereact-native-fetch-blob
0赞 Emilis Kakanis 12/8/2020
现在我安装了新版本的 firebase,我看到 package.json 和 podfile.lock 版本的 firebase 不同,如何更新 podfile.lock
0赞 Emilis Kakanis 12/8/2020
我现在收到此错误CocoaPods 找不到 pod “Firebase/Analytics” 的兼容版本: 在快照 (Podfile.lock) 中: Firebase/Analytics (= 6.30.0, ~> 6.30.0) 在 Podfile 中: RNFBAnalytics (from ) 已解析为 10.1.1,这取决于 Firebase/Analytics (~> 7.1.0)../node_modules/@react-native-firebase/analytics
1赞 Emilis Kakanis 12/8/2020
@MeisamSaba你能查看我的回放吗

答:

1赞 SUJIN S 12/8/2020 #1

pod 'React-Core', :path => '../node_modules/react-native/'在你的Podfile

2赞 Punter Bad 3/5/2021 #2

我以前遇到过这个问题,结果发现应用程序的依赖项之一(react-native-fetch-blob)在它的 PodSpec 中有 React/Core 而不是 React-Core 我更改了为我解决问题的最后一行。s.dependency 'React/Core's.dependency 'React-Core'

0赞 Pratik Gondaliya 11/18/2023 #3

溶液:

导航到 node_modules 目录中的 react-native-fetch-blob 模块,找到 react-native-fetch-blob.podspec 文件。路径应类似于 node_modules/react-native-fetch-blob/react-native-fetch-blob.podspec。

在您选择的文本编辑器中打开 react-native-fetch-blob.podspec 文件。

在 podspec 文件中查找列出依赖项的部分。此部分通常包含以 s.dependency 开头的行。

找到提到对 React/Core 的依赖的行。它可能看起来像这样:

s.dependency 'React/Core'

将其更改为:

s.dependency 'React-Core'

保存对 podspec 文件所做的更改。

进行更改后,在终端中导航到 React Native 项目的 ios 目录并运行:

pod install

这将使用修改后的 podspec 文件重新安装 iOS 依赖项,包括 react-native-fetch-blob。