【问题标题】:Cocoa pods if install without version, it installed old packageCocoa pods 如果没有安装版本,它会安装旧包
【发布时间】:2017-08-03 15:23:39
【问题描述】:

我将我的图书馆推到可可豆荚中。现在它有 1.0.1 版本:

pod spec lint USBDeviceSwift.podspec
pod trunk push USBDeviceSwift.podspec

一切正常,但如果我安装它没有版本:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'testusb' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for testusb

  pod 'USBDeviceSwift'

end

它安装了旧包 0.0.1。如果我想再次推动它,我会得到:

[!] Unable to accept duplicate entry for: USBDeviceSwift (1.0.1)

'USBDeviceSwift', '~>1.0.1' - 效果很好

【问题讨论】:

    标签: ios objective-c swift macos cocoa


    【解决方案1】:

    这不是您的 podspec 的问题,而是您如何在示例项目中使用它。发出 pod install 不会升级之前安装的 pod 的版本。保存在Podfile.lock 中的版本被再次拉下。如果你想升级你的 pod,你应该明确使用pod update [USBDeviceSwift]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-20
      • 2017-01-07
      • 2023-02-22
      相关资源
      最近更新 更多