2017-09-22 260 views
0

在我Podfile安装,我有:ReachabilitySwift不能用的CocoaPods

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文件。 否则,每个吊舱安装后都会出现错误。

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

回答

1

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

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

GitHub Issue

Podspec仍在寻找老V3的标签,现在手动指定回购和标签将解决:

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

我检查。在这种情况下,我将安装https://github.com/tonymillion/Reachability,而不是https://github.com/ashleymills/Reachability.swift。框架真的从ReachabilitySwift变成了Reachability。但是pod没有改变,所以奇怪的是我无法安装pod'ReachabilitySwift' –

+0

@PaulT。检查我更新的答案。 – the4kman