运行 `pod repo update` 后无法安装 FBSDKCoreKit 旧版本

Can not install FBSDKCoreKit old version after run `pod repo update`

我有一个 swift 3 项目。我尝试升级到 swift 4.2,当我 运行 pod install 时,它要求我 运行 pod repo update。我做到了,pod install 成功了

但是有点麻烦,我又回到了swift 3. 现在我 运行 pod install 安装新版本的 FBSDKCoreKit

Installing FBSDKCoreKit (5.4.1)
Installing FBSDKLoginKit (5.4.1)
Installing FBSDKShareKit (5.4.1)

这与我的 swift 3 项目不兼容。 我想要 FBSDKCoreKit (4.40.0) 或更老。

我已将 Podfile 更改为

target 'EPARK' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for EPARK
pod 'FacebookCore', '4.40.0'
pod 'FacebookLogin' '4.40.0'
pod 'FacebookShare'
pod 'ReachabilitySwift'

并得到这个错误:

[!] Unable to satisfy the following requirements:

- `FacebookCore (= 4.40.0)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `FacebookCore (= 4.40.0)`.

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

gem 的来源似乎已更改。

请帮帮我。 谢谢

乍一看,您似乎混淆了 pod 名称。 查看发布日志 FacebookCore = https://github.com/facebook/facebook-swift-sdk/releases

这里最高版本是0.8,找不到你设置的4.40.0版本

FBSDKCoreKit = https://github.com/facebook/facebook-objc-sdk/releases

虽然这里的最新版本是5.4.1

看来您在第二个广告连播中也缺少逗号

pod 'FacebookLogin' '4.40.0'

终于在github上找到了解决方案和正确的版本。 特别感谢@valosip

+ pod 'FacebookCore', :git => 'https://github.com/facebook/facebook-sdk-swift.git', :tag => '0.4.0'
+  pod 'FacebookLogin', :git => 'https://github.com/facebook/facebook-sdk-swift.git', :tag => '0.4.0'
+  pod 'FacebookShare', :git => 'https://github.com/facebook/facebook-sdk-swift.git', :tag => '0.4.0'