xcode CocoaPods找不到pod“Firebase/Core”的兼容版本

kknvjkwl  于 2022-11-18  发布在  其他
关注(0)|答案(3)|浏览(218)

这是我的播客文件:

source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'Unity-iPhone' do
pod 'Google-Mobile-Ads-SDK', '7.3.1'
pod 'Firebase/Core'
end

当我运行“pod install”时,它工作得很好
输出:

Analyzing dependencies
Downloading dependencies
Using Firebase (4.13.0)
Using FirebaseAnalytics (4.2.0)
Using FirebaseCore (4.0.20)
Using FirebaseInstanceID (2.0.10)
Using Google-Mobile-Ads-SDK (7.3.1)
Using GoogleToolboxForMac (2.1.4)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 7 total pods installed.

完美,一切都很好,但如果我添加一个特定的版本与FirebaseCore,像下面的代码:

pod 'Firebase/Core','4.0.20'

和“pod安装”
输出:

[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
  In Podfile:
    Firebase/Core (= 4.0.20)

None of your spec sources contain a spec satisfying the dependency: `Firebase/Core (= 4.0.20)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

实际上,FirebaseCore与4.0.20是存在的,那么我应该如何修复它?

rdlzhqv9

rdlzhqv91#

我现在就修复了它,只需将Firebase/Core更改为FirebaseCore(我在GitHub中检查了FirebaseCore.podspec文件。)

balp4ylt

balp4ylt2#

FirebaseFirebaseCore的podspec版本是分开的,因此不应互换使用。Firebase pod是Firebase/CoreFirebase/Analytics等子规范的父项,但FirebaseCore使用的版本不同,因为FirebaseCore不是Firebase的子规范,而Firebase/Core是。
Firebase podspec可供参考:https://github.com/CocoaPods/Specs/blob/980d013a857e7ef973531f1cf85ddb5b8a56d1b0/Specs/0/3/5/Firebase/5.10.0/Firebase.podspec.json

vyswwuz2

vyswwuz23#

project/ios文件夹中按顺序运行以下命令:

pod update Firebase/Core 
pod install --repo-update

相关问题