在 React Native 中安装具有冲突的 GoogleMLKit/FaceDetection 依赖项的 pod 时出错

问题描述 投票:0回答:1

我在使用 CocoaPods 在 React Native 项目中安装 pod 时遇到问题。执行 pod install 后,我收到以下错误:

[!] CocoaPods 找不到 pod 的兼容版本 “GoogleMLKit/FaceDetection”:在 Podfile 中: React-native-face-detection(来自

../node_modules/react-native-face-detection
)被解析为 0.1.1, 这取决于 GoogleMLKit/FaceDetection (= 2.2.0)

vision-camera-face-detector (from `../node_modules/vision-camera-face-detector`) was resolved to 0.1.8,

这取决于 GoogleMLKit/人脸检测

您的规范源都不包含满足依赖关系的规范:

GoogleMLKit/FaceDetection (= 2.2.0), GoogleMLKit/FaceDetection

您有: * 过时的源代码库,您可以使用它进行更新

pod repo update
或与
pod install --repo-update
。 * 打错了 名称或版本。 * 未添加托管 Podspec 的源存储库 到你的 Podfile。

与 GoogleMLKit/FaceDetection 相关的依赖关系似乎存在冲突。我已尝试使用 pod repo update 和 pod install --repo-update 更新 pod 存储库,但问题仍然存在。

这是我的 Podfile 中的片段:

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

  pod 'RNFS', :path => '../node_modules/react-native-fs'

  pod 'GoogleMLKit/FaceDetection', '2.2.0'
  pod 'GoogleMLKit/MLKitCore', '2.2.0'
  pod 'GoogleMLKit/TextRecognition', '2.6.0'
ios react-native cocoapods google-mlkit podfile
1个回答
0
投票

您是否尝试过删除 Pod 和 Podfile.lock ?

cd ios => rm-rf Pods Podfile.lock => Pod install

也许这可以帮助修复,如果没有尝试删除之前的node_modules并再次安装所有包,它们会删除Pods Podfile.lock并安装Pod。我希望这能有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.