我目前正在尝试使用 Ionic React(电容器)实现 RevenueCat SDK,在使用 Ionic Appflow 构建应用程序时出现以下错误
[18:38:13]: ▸ [error] Error running update: Analyzing dependencies
[18:38:13]: ▸ Fetching podspec for `Capacitor` from `../../node_modules/@capacitor/ios`
[18:38:13]: ▸ Fetching podspec for `CapacitorCommunityHttp` from `../../node_modules/@capacitor-community/http`
[18:38:13]: ▸ Fetching podspec for `CapacitorCordova` from `../../node_modules/@capacitor/ios`
[18:38:13]: ▸ Fetching podspec for `CordovaPlugins` from `../capacitor-cordova-ios-plugins`
[18:38:13]: ▸ Fetching podspec for `CordovaPluginsStatic` from `../capacitor-cordova-ios-plugins`
[18:38:13]: ▸ [!] CocoaPods could not find compatible versions for pod "PurchasesHybridCommon":
[18:38:13]: ▸ In Podfile:
[18:38:13]: ▸ CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`) was resolved to 2.4.0, which depends on
[18:38:13]: ▸ PurchasesHybridCommon (= 1.2.0)
[18:38:13]: ▸ None of your spec sources contain a spec satisfying the dependency: `PurchasesHybridCommon (= 1.2.0)`.
[18:38:13]: ▸ You have either:
[18:38:13]: ▸ * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
[18:38:13]: ▸ * mistyped the name or version.
[18:38:13]: ▸ * not added the source repo that hosts the Podspec to your Podfile.
[18:38:13]: ▸ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
[18:38:13]: ▸ Sync finished in 3.219s
@enc_life 的评论对我有用(在 Flutter 应用程序上,而不是 React,但我猜 iOS 部分的工作原理是一样的):
pod install --repo-update
此后,一切都如魔法般顺利。
我收到的错误消息是
[!] CocoaPods could not find compatible versions for pod "PurchasesHybridCommon":
In Podfile:
purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`) was
resolved to 1.4.3, which depends on PurchasesHybridCommon (= 1.4.5)
None of your spec sources contain a spec satisfying the dependency:
`PurchasesHybridCommon (= 1.4.5)`.
尝试清理你的podfile并重新安装; 移至 ios/App 文件夹:
pod cache clean --all
rm -rf Podfile.lock
pod install