这里写自定义目录标题
cocoapod install 时 Unsupported protocol
参考:CDN is just not working The solution of above is pod repo remove trunk and pod install
手动创建CocoaPods-version.yml
文件,并复制内容保存
---
min: 1.0.0
last: 1.11.2
prefix_lengths:
- 1
- 1
- 1
最近升级cocoapod到1.9.3, install --verbose
时报错CDN: trunk URL couldn't be downloaded:https://*** Response: Unsupported protocol
查看报错信息是cocoapod下载https://cdn.cocoapods.org/all_pods_versions_d_8_2.txt
,及CocoaPods-version.yml
文件时遇到不支持的协议,具体在.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/cdn_source.rb
的download_and_save_with_retries_async
抛出的异常。源码用使用的下载工具是Hydra(libcurl reactor)
,但没到找具体Hydra
报错原因。
进入~/.cocoapods/repos/trunk/
,其实能看到CocoaPods-version.yml
文件,查看下面报错日志,如果文件存在就不在进行下载。所以可以将报错失败的all_pods_versions_d_8_2.txt
手动下载并将其放到~/.cocoapods/repos/trunk/
目录下。然后再次install,将正常了。
另外升级后,执行pod setup报错,下载trunk分支时速度巨慢,可以尝试到GitHub将整个项目下载下来,并对压缩其解压,放入~/.cocoapods/repos/
中,路径结果是~/.cocoapods/repos/trunk/
。
终端报错信息
$ pod install --verbose
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-demo`: (``)
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/all_pods_versions_d_8_2.txt Response: Unsupported protocol, retries: 4
CDN: trunk URL couldn't