• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 如何知道您的 cocoapod 安装指向哪个 pod 规范文件

[复制链接]
菜鸟教程小白 发表于 2022-12-13 07:29:55 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我正在尝试安装 sharekit通过cocoapods。如果我在 cocoapod 网站上搜索 sharekit.. 我被指示将其放入 podfile 中:

pod 'ShareKit', '~> 2.5'

网站上的sharekit pod链接到this podspec 文件,标记为 2.5.6。

到目前为止一切顺利。

但是当我运行 pod install 命令时(我还添加了 platform :ios, '6.0' b/c 不这样做会引发兼容性错误)我明白了错误:

[!] Unable to satisfy the following requirements: - SSKeychain (~> 0.2.1) required by ShareKit/Core (2.5.6)- SSKeychain (~> 1.2.2) required by Evernote-SDK-iOS (1.3.1)

我的问题是:为什么它说明 evernote 1.3.1 需要什么? b/c 2.5.6 podspec 里面有这个:

s.subspec 'Evernote' do |evernote|
   evernote.source_files = 'Classes/ShareKit/Sharers/Services/Evernote/**/*.{h,m}'
   evernote.dependency 'Evernote-SDK-iOS', '~> 1.3.0'
   evernote.dependency 'ShareKit/Core'
   evernote.libraries = 'xml2'
   evernote.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
 end

所以它显然链接到 evernote 1.3.0

podspec在 sharekit master repo 上确实将 evernote 1.3.1 列为依赖项..但这与我的 pod 安装请求有什么关系?

让事情变得更奇怪.. 我放 pod 'ShareKit', '~> 2.5.6'pod 'ShareKit', '~> 2.5 都没关系.3'.. 我在谈论 sharekit 2.5.6 时仍然遇到错误.. 为什么会这样?



Best Answer-推荐答案


下面解释了如何将 pod 版本链接到您的项目中(它与 Semantic Versioning 密切相关。

Besides no version, or a specific one, it is also possible to use logical operators:

'> 0.1' Any version higher than 0.1

'>= 0.1' Version 0.1 and any higher version

'< 0.1' Any version lower than 0.1

'<= 0.1' Version 0.1 and any lower version

In addition to the logic operators CocoaPods has an optimisic operator ~>:

'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher

'~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher

'~> 0' Version 0 and higher, this is basically the same as not having it.

来源:http://guides.cocoapods.org/using/the-podfile.html

如果您想明确链接到特定版本,请将您的 podfile 更改为以下内容:

pod 'ShareKit', '2.5'

关于ios - 如何知道您的 cocoapod 安装指向哪个 pod 规范文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23286127/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap