很久没跑ios项目,今天pod Install报这个错,记录一下
Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
# 过了很久很久没反应
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`.
You can try adding it manually in `/Users/xxx/.cocoapods/repos` or via `pod repo add`.
1,解决方案
cd ~/.cocoapods/repos/
检查一下 master 文件夹是否存在,如果存在 master 文件夹,执行 pod repo remove master。不存在则跳过这一条命令。
pod repo remove master
接下来继续执行以下命令
pod setup
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
如果失败,尝试科学上网。
此时应该已经解决问题了。
2,切换远程分支参考:解决git clone过大的仓库_csdnwr的博客-CSDN博客_gitlab远程仓库太大文章来源:https://www.toymoban.com/news/detail-558173.html
git remote set-branches origin '*'
文章来源地址https://www.toymoban.com/news/detail-558173.html
到了这里,关于Pod Install 报错失败解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!