【问题标题】:Pod install keep installing Alamofire with a wrong versionPod install 继续安装错误版本的 Alamofire
【发布时间】:2017-04-09 18:35:54
【问题描述】:

Podfile:

platform :ios, '10.0'
use_frameworks!
target 'Netsil' do
  # Pods for Netsil

  # Upload
  pod 'SwiftyJSON', :git => 'https://github.com/acegreen/SwiftyJSON.git', :branch => 'swift3'
  pod 'Alamofire', '~> 4.0'

  # Login
  pod 'FacebookCore'
  pod 'FacebookLogin'
  pod 'FacebookShare'

  pod 'FBSDKCoreKit'
  pod 'FBSDKShareKit'
  pod 'FBSDKLoginKit'

  pod 'GoogleSignIn'
  pod 'Firebase/Auth'

  pod 'Fabric'
  pod 'TwitterKit'

end

我不断得到:

pod install
Analyzing dependencies
Downloading dependencies
Using Alamofire (4.2.0)
Using Bolts (1.8.4)
Using FBSDKCoreKit (4.18.0)
Using FBSDKLoginKit (4.18.0)

我想要 4.0 而不是 4.2 ...

【问题讨论】:

  • 根据文档 (guides.cocoapods.org/using/the-podfile.html): '~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher 所以,在你的情况下,它应该安装 4.4。所以使用'~> 4.0.1'pod 'Alamofire', '4.0'?
  • 感谢@Larme 我使用了 4.0 并安装了 4.0.1

标签: swift3 cocoapods alamofire


【解决方案1】:

更改以下行:

pod 'Alamofire', '~> 4.0'

到:

pod 'Alamofire', '<= 4.0'

您将获得 Alamofire 4.0 :) 我相信根据您目前拥有的产品线,您将获得从 4.0 到 5.0 的任何版本,但不包括 5.0 或更高版本...

【讨论】:

    猜你喜欢
    • 2017-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    • 2017-02-10
    • 1970-01-01
    • 1970-01-01
    • 2016-09-13
    相关资源
    最近更新 更多