常見問題
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,世界又變得美好