【问题标题】:How to install SwiftyJSON on osx如何在 osx 上安装 SwiftyJSON
【发布时间】:2018-09-08 00:26:04
【问题描述】:

我尝试使用以下内容创建文件:

  1. 创建 Podfile

'

platform :osx, '10.0'
use_frameworks!

target 'MyApp' do
    pod 'SwiftyJSON', '~> 2.2.0'
end
  1. 运行命令

    吊舱安装

重新调整:

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "SwiftyJSON":
  In Podfile:
    SwiftyJSON (~> 2.2.0)

Specs satisfying the `SwiftyJSON (~> 2.2.0)` dependency were found, but they required a higher minimum deployment target.

我认为这可能与平台有关,因此我访问了 CoCaoPods.org 上的 SwiftJSON 文档。

这是我发现的

哦,看起来可能不是“osx”,而是“macOS”。我将我的 Podfile 更新为:

platform :macOS, '10.0'
use_frameworks!

target 'Maconomi' do
    pod 'SwiftyJSON', '~> 2.2.0'
end

然后再次运行之前的命令并得到这个错误:

[!] Invalid `Podfile` file: Unsupported platform `macOS`. Platform must be `:ios`, `:osx`, `:tvos`, or `:watchos`..

 #  from /Users/travis.rivera/Documents/macOSAPP/Maconomi/Podfile:1
 #  -------------------------------------------
 >  platform :macOS, '10.0'
 #  use_frameworks!
 #  -------------------------------------------

所以现在我被卡住了。

【问题讨论】:

  • 我可能在这里遗漏了一些东西,但是...不是 10.0 小于 10.10 吗?考虑到 10.0 有多旧,这是一个错字吗?
  • 将 10.0 更改为 10.10 有效。这是一个错误,但我不会称之为错字。

标签: swift cocoapods swifty-json


【解决方案1】:
platform :osx, '10.10'
use_frameworks!

target 'MyApp' do
    pod 'SwiftyJSON', '~> 2.2.0'
end

然后

吊舱安装

我错过了osx最低版本号。

【讨论】:

  • 对于其他人,您可以使用:macos,只要它全部小写即可。
猜你喜欢
  • 2010-12-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-24
  • 2012-09-09
  • 2013-08-20
  • 2013-11-30
相关资源
最近更新 更多