【发布时间】:2015-07-26 01:50:47
【问题描述】:
我有以下 cocoapods Podfile
platform :ios, '8.0'
use_frameworks!
target 'Foo' do
pod "SwiftyJSON", '~> 2.2.0'
pod "Locksmith"
pod "GoogleMaps"
pod "RealmSwift"
end
target 'FooTests' do
end
我也在使用 cocoapods 0.37.2。出于某种原因,当我尝试运行该应用程序时,它会抱怨以下错误,而我明确指定我的项目需要 SwiftyJSON 2.2.0 或更高版本:
Reason: Incompatible library version: Foo requires version 2.0.0 or later, but SwiftyJSON provides version 1.0.0
我已验证 SwiftyJSON 没有其他依赖项(使用 cocoapods-dependencies):
$pod dependencies
Dependencies
---
- GoogleMaps (1.10.1)
- Locksmith (1.2.2)
- Realm (0.93.2):
- Realm/Headers (= 0.93.2)
- Realm/Headers (0.93.2)
- RealmSwift (0.93.2):
- Realm (= 0.93.2)
- SwiftyJSON (2.2.0)
如您所见,没有人在拉 SwiftyJSON 1.0.0。顺便说一句,我使用 cocoapods 0.37.2 的原因是因为我尝试使用 0.38.1 时出现的这个错误:https://github.com/CocoaPods/CocoaPods/issues/3890。
我在这里遗漏了什么吗(关于 SwiftyJSON 版本不匹配)?我试过清理项目,重做 pod install 等,但没有任何运气..
提前致谢!
【问题讨论】:
-
好吧。这听起来很疯狂,但我只是将 SwiftyJSON 作为一个 dep 删除,将 cocoapods 升级到 0.38.0,再次添加 SwiftyJSON,然后进行 pod 安装。然后重新打开我的项目。一切看起来都很好。我不知道是因为升级,还是因为remove-and-add-again解决了我的问题。我今天浪费了大约 3 个小时试图解决这个愚蠢的问题。
-
我也遇到了同样的问题,今天也开始了(安装 cocoapods 0.38.1 之后,我已经降级到 0.37.2 并且仍在发生)