如何在osx上安装SwiftyJSON

问题描述 投票:1回答:1

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

  1. 创建Podfile

'

platform :osx, '10.0'
use_frameworks!

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

这被重新调整:

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文档。

这是我发现的

enter image description here

哦,看起来可能代替'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!
 #  -------------------------------------------

所以现在我被卡住了。

swift cocoapods swifty-json
1个回答
0
投票
platform :osx, '10.10'
use_frameworks!

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

然后

pod安装

我错过了osx最低版本号。

© www.soinside.com 2019 - 2024. All rights reserved.