ReachabilitySwift 无法与 CocoaPods 一起安装

ReachabilitySwift can't be installed with CocoaPods

在我的 Podfile 中,我有:

pod 'ReachabilitySwift', '~> 3.0'

但是当我 运行 pod install 时,除了 ReachabilitySwift:

之外所有框架都设置正确
Installing ReachabilitySwift 3 (was 2.4)

[!] Error installing ReachabilitySwift
[!] /usr/bin/git clone https://github.com/ashleymills/Reachability.swift.git /var/folders/cn/1zzgfkjj5xq3hm3g4351087r0000gn/T/d20170922-5156-v06cm4 --template= --single-branch --depth 1 --branch v3

Cloning into '/var/folders/cn/1zzgfkjj5xq3hm3g4351087r0000gn/T/d20170922-5156-v06cm4'...
warning: Could not find remote branch v3 to clone.
fatal: Remote branch v3 not found in upstream origin

有了这个GitHub link,我找到了一个推荐的解决方案:

Please add a

s.pod_target_xcconfig = {
    'SWIFT_VERSION' => '3.0'
}

to the podspec file. Otherwise, there will be an error after each pod install.

但是我不知道在哪里可以找到 podspec 文件以及在什么地方插入这个字符串。

您不必手动编辑 podspec 文件,这将涉及分叉项目。

项目的 podspec 文件引用了错误的标签,您应该指定正确的标签并使用它,直到修复 podspec 文件。

来自GitHub Issue:

Podspec is still looking for the old v3 tag, for now manually specify the repo and tag will fix:

pod 'ReachabilitySwift', :git => 'https://github.com/ashleymills/Reachability.swift.git', :tag => 'v3.0'