CocoaPods出現錯誤[!] CDN: trunk Repo update failed與[!] CDN: trunk URL couldn't be downloaded:

問題一:CocoaPods升級到1.8.4版本後,pod search 查詢1個庫的版本的時候報錯如下:

[!] CDN: trunk URL couldn’t be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/3/9/b/PulseReactiveC/3.1.1/PulseReactiveC.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for “raw.githubusercontent.com” port 443)

解決方案:執行 pod repo remove trunk 命令,移除掉trunk源就行了

問題二:CocoaPods升級到1.8.4版本後,pod install 安裝庫的版本的時候報錯如下:

[!] CDN: trunk Repo update failed - 26 error(s):
CDN: trunk URL couldn’t be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/9/2/f/JCore/1.0.0/JCore.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for “raw.githubusercontent.com” port 443)

解決方案: podfile文件中指定source源爲master,因爲默認的是trunk源,,修改後pod install和pod update就可以正常操作,設置方法如下圖所示。

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

在這裏插入圖片描述

發佈了10 篇原創文章 · 獲贊 9 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章