CocoaPods 在 React Native ios 上找不到 pod "Firebase/CoreOnly" 的兼容版本
CocoaPods could not find compatible versions for pod "Firebase/CoreOnly" on React Native ios
我正在尝试将 React Native Firebase Mlkit 安装到我现有的 iOS React Native 应用程序。我的应用程序已经在使用各种 Firebase 包(app、auth、firestore 等)。
我正在按照指南中的说明进行操作。我尝试了自动和手动安装。但是当我 运行 pod install
时,我得到了这个错误:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In Podfile:
Firebase/MLVisionTextModel was resolved to 5.0.0, which depends on
Firebase/CoreOnly (= 5.0.0)
RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 14.3.0, which depends on
Firebase/CoreOnly (= 8.11.0)
这是我的 POD 文件:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.0'
target 'com.xxxxxx.xxxxxxx' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
pod 'Firebase/Core'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'Firebase/MLVisionBarcodeModel'
target 'com.xxxxxxx.xxxxxxxxTests' do
inherit! :complete
# Pods for testing
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-receive-sharing-intent', :path => '../node_modules/react-native-receive-sharing-intent'
pod 'RNMlKit', :path => '../node_modules/react-native-firebase-mlkit/ios'
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
这是我的 package.json:
{
"name": "xxxxxxxx",
"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": {
"@dudigital/react-native-zoomable-view": "^1.1.3",
"@invertase/react-native-apple-authentication": "^2.1.5",
"@react-native-async-storage/async-storage": "^1.15.14",
"@react-native-community/cli": "^6.3.1",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-firebase/app": "^14.3.0",
"@react-native-firebase/auth": "^14.3.0",
"@react-native-firebase/firestore": "^14.3.0",
"@react-native-firebase/storage": "^14.3.0",
"@react-native-google-signin/google-signin": "^7.0.3",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"i18n-js": "^3.8.0",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-document-picker": "^7.1.2",
"react-native-eject": "^0.1.2",
"react-native-firebase-mlkit": "^0.6.2",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.2.0",
"react-native-image-picker": "^4.6.0",
"react-native-material-menu": "^2.0.0",
"react-native-receive-sharing-intent": "^2.0.0",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.1",
"react-native-share": "^7.3.2",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^12.1.1",
"react-native-swiper": "^1.6.0",
"react-native-vector-icons": "^9.0.0",
"react-native-vision-camera": "^2.12.0",
"react-redux": "^7.2.6",
"redux-persist": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
这里有很多类似的问题,但没有任何效果。这是我按不同顺序尝试的各种命令的列表:
- 已删除 Pods 文件夹
rm -rf Podfile.lock
pod update
pod repo update
pod install --repo-update
- 从 pod 文件中删除
pod 'Firebase/Core'
1) 首先 Firebase/MLVisionTextModel
已弃用 (). You can read the migration guide here (https://developers.google.com/ml-kit/migration)
2) 如果你经常遇到类似 was resolved to x.x.x, which depends on Firebase/CoreOnly (= x.x.x)
的错误,你可以通过在 PodFile 的最顶部添加以下内容来解决这个问题,以指定什么要使用的版本。
$FirebaseSDKVersion = '8.10.0'
我正在尝试将 React Native Firebase Mlkit 安装到我现有的 iOS React Native 应用程序。我的应用程序已经在使用各种 Firebase 包(app、auth、firestore 等)。
我正在按照指南中的说明进行操作。我尝试了自动和手动安装。但是当我 运行 pod install
时,我得到了这个错误:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In Podfile:
Firebase/MLVisionTextModel was resolved to 5.0.0, which depends on
Firebase/CoreOnly (= 5.0.0)
RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 14.3.0, which depends on
Firebase/CoreOnly (= 8.11.0)
这是我的 POD 文件:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.0'
target 'com.xxxxxx.xxxxxxx' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
pod 'Firebase/Core'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'Firebase/MLVisionBarcodeModel'
target 'com.xxxxxxx.xxxxxxxxTests' do
inherit! :complete
# Pods for testing
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-receive-sharing-intent', :path => '../node_modules/react-native-receive-sharing-intent'
pod 'RNMlKit', :path => '../node_modules/react-native-firebase-mlkit/ios'
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
这是我的 package.json:
{
"name": "xxxxxxxx",
"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": {
"@dudigital/react-native-zoomable-view": "^1.1.3",
"@invertase/react-native-apple-authentication": "^2.1.5",
"@react-native-async-storage/async-storage": "^1.15.14",
"@react-native-community/cli": "^6.3.1",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-firebase/app": "^14.3.0",
"@react-native-firebase/auth": "^14.3.0",
"@react-native-firebase/firestore": "^14.3.0",
"@react-native-firebase/storage": "^14.3.0",
"@react-native-google-signin/google-signin": "^7.0.3",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"i18n-js": "^3.8.0",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-document-picker": "^7.1.2",
"react-native-eject": "^0.1.2",
"react-native-firebase-mlkit": "^0.6.2",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.2.0",
"react-native-image-picker": "^4.6.0",
"react-native-material-menu": "^2.0.0",
"react-native-receive-sharing-intent": "^2.0.0",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.1",
"react-native-share": "^7.3.2",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^12.1.1",
"react-native-swiper": "^1.6.0",
"react-native-vector-icons": "^9.0.0",
"react-native-vision-camera": "^2.12.0",
"react-redux": "^7.2.6",
"redux-persist": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
这里有很多类似的问题,但没有任何效果。这是我按不同顺序尝试的各种命令的列表:
- 已删除 Pods 文件夹
rm -rf Podfile.lock
pod update
pod repo update
pod install --repo-update
- 从 pod 文件中删除
pod 'Firebase/Core'
1) 首先 Firebase/MLVisionTextModel
已弃用 (
2) 如果你经常遇到类似 was resolved to x.x.x, which depends on Firebase/CoreOnly (= x.x.x)
的错误,你可以通过在 PodFile 的最顶部添加以下内容来解决这个问题,以指定什么要使用的版本。
$FirebaseSDKVersion = '8.10.0'