[!] CDN: trunk Repo update failed


https://www.jianshu.com/p/bf1cbe49cb5d

 

由於項目是用CocoaPods管理,CocoaPods 1.8將CDN切換為默認的spec repo源,並附帶一些增強功能!CDN支持最初是在1.7版本中引入的,最終在1.7.2中完成。 它旨在大大加快初始設置和依賴性分析。

目前項目使用pods的是1.8.4版本

Ribers-Mac:ZNB_Country2.0 Riber$ pod --version 1.8.4 

最近使用pods,卻出現了一下錯誤!

[!] CDN: trunk Repo update failed - 17 error(s): CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/d/4/CocoaAsyncSocket/0.0.1/CocoaAsyncSocket.podspec.json, error: Operation timed out - SSL_connect ... 

按照官方文檔 podfile文件中添加source源:
source 'https://github.com/CocoaPods/Specs.git'
podfile文件中添加source源后,pod installpod update可以正常操作,但是pod search有些庫卻不正常。

Ribers-Mac:ZNB_Country2.0 Riber$ pod search mj [!] CDN: trunk Repo update failed - 3 error(s): CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/f/b/MJRefresh/0.0.1/MJRefresh.podspec.json, error: Operation timed out - SSL_connect CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/f/b/MJRefresh/1.4.4/MJRefresh.podspec.json, error: Operation timed out - SSL_connect CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/f/b/MJRefresh/2.4.9/MJRefresh.podspec.json, error: Operation timed out - SSL_connect Ribers-Mac:ZNB_Country2.0 Riber$ pod search rbtitle -> RBTitleView (2.0.1) 簡單實用的titleView pod 'RBTitleView', '~> 2.0.1' - Homepage: https://github.com/RiberWang/RBTitleDemo - Source: https://github.com/RiberWang/RBTitleDemo.git - Versions: 2.0.1, 1.0.1, 1.0.0 [master repo] 

解決辦法:

1. podfile文件中指定source源為master:

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

2.執行pod repo remove trunk移除trunk源

執行完后,pod search就都正常了!

Ribers-Mac:ZNB_Country2.0 Riber$ pod repo list master - Type: git (master) - URL: https://github.com/CocoaPods/Specs.git - Path: /Users/Riber/.cocoapods/repos/master trunk - Type: CDN - URL: https://cdn.cocoapods.org/ - Path: /Users/Riber/.cocoapods/repos/trunk 2 repos Ribers-Mac:ZNB_Country2.0 Riber$ pod repo remove trunk Removing spec repo `trunk` 
注意:podfile文件中一定要指定master源,因為現在默認是trunk

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

參考文章:
  1. 官方說明(英語不好的同志可在谷歌瀏覽器中打開使用其翻譯功能)
  2. Github Issules


作者:RiberWang
鏈接:https://www.jianshu.com/p/bf1cbe49cb5d
來源:簡書
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM