【问题标题】:Can not install RealmSwift with cocoapods无法使用 cocoapods 安装 RealmSwift
【发布时间】:2016-09-26 13:06:52
【问题描述】:

每次我尝试使用 cocoapods 安装 RealmSwift 时都会给我 [!] /bin/bash -c set -e sh build.sh cocoapods-setup 错误。我已经更新到 xcode 8 和 cocoapods 到 1.1.0 但是,当我从另一台装有旧可可的 Mac 上尝试时,RealmSwift 1.0.2 正在安装中。

请帮忙

【问题讨论】:

  • 你的 podfile 是什么样的?您可以将其添加到您的问题中吗?
  • A) 请分享您的 Podfile。 B) 请务必在安装前运行pod repo update。 CocoaPods 不再自动执行此操作。

标签: ios cocoa realm swift3


【解决方案1】:

打开终端并点击此命令

$ [sudo] gem install cocoapods

它只会更新您系统的 CocoaPods 版本。然后尝试使用它安装 Realm。

将这段代码添加到 pods 文件中,

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0'
    end
  end
end

它将为您最新的 swift 版本添加 Realm。

【讨论】:

    猜你喜欢
    • 2016-06-14
    • 1970-01-01
    • 2021-03-24
    • 1970-01-01
    • 2014-01-14
    • 2018-04-20
    • 2023-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多