ios CocoaPods could not find compatible versions for pod“React/Core”

sr4lhrrt  于 12个月前  发布在  iOS
关注(0)|答案(3)|浏览(97)

我试图在iPhone上启动react-native应用程序。现在我正在使用命令pod install安装pod,但它向我抛出错误:
CocoaPods找不到Pod“React/Core”的兼容版本:
在Podfile中:react-native-fetch-blob(来自../node_modules/react-native-fetch-blob)被解析为0.10.6,这取决于React/Core
没有一个spec源包含满足依赖项React/Core的spec。
您可能:* 名称或版本输入错误。* 未将托管Podspec的源代码库添加到您的Podfile。
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
}

字符串

6za6bjd0

6za6bjd01#

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

dzjeubhm

dzjeubhm2#

pod'React-Core',:path =>'../node_modules/react-native/'在您的Podfile中尝试此代码

w8f9ii69

w8f9ii693#

解决方案:
**1.找到Podspec文件:**导航到node_modules目录下的react-native-fetch-blob模块,找到react-native-fetch-blob.podspec文件,路径应该类似于node_modules/react-native-fetch-blob/react-native-fetch-blob. podspec。
**2.打开Podspec文件:**在您选择的文本编辑器中打开react-native-fetch-blob.podspec文件。
**3.查找Dependency部分:**查找podspec文件中列出依赖项的部分,该部分通常包含以s. dependency开头的行。
**4.更改依赖行:**找到提到对React/Core的依赖的行。它可能看起来像这样:

s.dependency 'React/Core'

字符串
将其更改为:

s.dependency 'React-Core'

**5.保存更改:**保存您对podspec文件所做的更改。
**6.运行pod install:**修改完成后,在终端中导航到React Native项目的ios目录,运行:

pod install


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

相关问题