【问题标题】:Why can't CocoaPods access RealmSwift为什么 CocoaPods 不能访问 RealmSwift
【发布时间】:2015-10-14 20:52:42
【问题描述】:

我正在尝试将 Realm 与 Swift 2.0 一起使用 我的 Podfile 很简单:

source 'https://github.com/CocoaPods/Specs.git'

pod 'AWSS3', '~> 2.2.0'

# Realm Frameworks
use_frameworks!
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-2.0'

但我得到了

[!] Unable to satisfy the following requirements:

- `RealmSwift (from `https://github.com/realm/realm-cocoa.git`, branch `swift-2.0`)` required by `Podfile`

在我看来,Podfile 的格式很好。如有任何帮助,我将不胜感激。

【问题讨论】:

  • 你在其他项目中使用过 Realm 框架吗?我以前遇到过这个问题(使用另一个 Pod),原来是我尝试使用的 Pod,而不是我的 Podfile。
  • 我刚试了你的 Podfile,它安装没有问题。除了您发布的内容之外,Podfile 中还有其他内容吗?
  • @joem 没有。就是这样。我发布的唯一错误是 'source 'github.com/CocoaPods/Specs.git'' 行应该是代码格式。
  • @joem 我将 cocoapods 更新到了最新版本,并得到了更有用的信息。 “已找到满足 RealmSwift (from github.com/realm/realm-cocoa.git, branch swift-2.0) 依赖项的规范,但它们需要更高的最小部署目标。”然后我将目标升级到 iOS9 并安装了它。

标签: cocoapods realm


【解决方案1】:

swift-2.0 分支几周前已经合并到 master 中。自 Swift 2 正式发布以来。因此,如果您使用最新的工具链,则不再需要指定 swift-2.0 分支。你可以写pod 'RealmSwift'

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

pod 'AWSS3', '~> 2.2.0'
pod 'RealmSwift'

【讨论】:

    猜你喜欢
    • 2021-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-14
    • 1970-01-01
    • 2016-06-14
    • 1970-01-01
    • 2016-01-19
    相关资源
    最近更新 更多