这是我的Podfile:
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.
实际上,存在带有4.0.20的FirebaseCore,那么我该如何解决?
答案 0 :(得分:0)
我现在已修复它,只需将Firebase / Core更改为FirebaseCore (在GitHub中检查了FirebaseCore.podspec文件。)
答案 1 :(得分:0)
Firebase
和FirebaseCore
的podspec版本是分开的,因此您不能互换使用。 Firebase
容器是子规范Firebase/Core
,Firebase/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
答案 2 :(得分:0)
按以下顺序在您的project / ios文件夹中运行以下命令:
pod update Firebase/Core
pod install --repo-update