【问题标题】:ReachabilitySwift can't be installed with CocoaPodsReachabilitySwift 无法与 CocoaPods 一起安装
【发布时间】:2017-09-22 19:56:39
【问题描述】:

在我的 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,我找到了推荐的解决方案:

请添加

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

到 podspec 文件。 否则每次pod安装后都会报错。​​

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

【问题讨论】:

    标签: ios swift cocoapods reachability reachability-swift


    【解决方案1】:

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

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

    来自GitHub Issue

    Podspec 仍在寻找旧的 v3 标签,现在手动指定 repo,标签将修复:

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

    【讨论】:

    猜你喜欢
    • 2021-05-03
    • 2021-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-04
    • 2015-09-10
    • 2016-06-14
    • 1970-01-01
    相关资源
    最近更新 更多