CocoaPods搜索不到最新库

2 篇文章 0 订阅
1 篇文章 0 订阅

场景:gitHub上已经更新了最新的库,但是cocoapods却搜索不到,我这里以HandyJSON库为例。
安装HandyJSON 5.0.0版本。

pod install 
        
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "HandyJSON":
  In snapshot (Podfile.lock):
    HandyJSON (= 5.0.0, ~> 5.0.0)

  In Podfile:
    HandyJSON (~> 5.0.0)

None of your spec sources contain a spec satisfying the dependencies: `HandyJSON (~> 5.0.0), HandyJSON (= 5.0.0, ~> 5.0.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

报错没有5.0.0版本。

#查看库版本 发现果然没有5.0.0版本
pod search HandyJSON 

1、鉴于以上错误,按照提示更新repo

pod repo update
可能报错,注意: `xxxxxx` != `master`
[!] CocoaPods was not able to update the `xxxxxx` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

这里报错可能是因为你本地的repos中又多个索引库文件,其中一个库在执行更新时出错,导致最终的更新失败。
在这里插入图片描述
在这里我们只需要更新master库即可,故执行命令

pod repo update master 

更新成功。
再安装HandyJSON 5.0.0版本成功了。

  • 可能遇到问题: pod repo update master 报错
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

解决:退出终端重新打开运行更新,又成功了。很奇怪。

备注:显示隐式文件—— cmd+shift+.
以上仅是记录自己在使用CocoaPods中遇到的问题,请视情况借鉴。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值