Cocoapods问题汇总

常见问题

 

0. 找不到指定版本的XXX

[!] CocoaPods could not find compatible versions for pod “XXX”:

1. 找不到指定依赖

None of your spec sources contain a spec satisfying the dependency:

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.

2. 连接不到服务器

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/all_pods_versions_f_2_b.txt Response: Couldn't connect to server

3. 验证失败

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/deprecated_podspecs.txt Response: SSL peer certificate or SSH remote key was not OK

 

Trunk源总有问题,导致不能install,不能update,不能search

 

 

官方解释

https://blog.cocoapods.org/CocoaPods-1.8.0-beta/

大概就是这么个意思

CocoaPods 1.8 切换CDN作为默认的spec repo源,并附带了一些增强功能!

在1.8版本中,CocoaPods不再需要克隆现在庞大的master specs repo才能正常工作,用户几乎可以立即将他们的项目与CocoaPods集成,支持master增量下载。

查看pod版本 

pod --version,更新到1.8之后的版本

 

最终解决

0. 在Podfile最上面添加指定master源

source 'https://github.com/CocoaPods/Specs.git'

1. 移除trunk源 

pod repo remove trunk

 

Install, update, search,世界又变得美好

原文地址:https://www.cnblogs.com/lyjpost/p/14113481.html