[!] Unable to add a source with url git@github.com/CocoaPods/Specs.git named cocoapods.

Analyzing dependencies
Cloning spec repo cocoapods from git@github.com/CocoaPods/Specs.git
[!] Unable to add a source with url git@github.com/CocoaPods/Specs.git named cocoapods.
You can try adding it manually in /Users/fxc/.cocoapods/repos or via pod repo add.在同一台电脑,当前项目pod install报这个错,另外一个pod install成功

解决:
1, 先去自己项目podfile里把source换了
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

如果pod install继续报错

Analyzing dependencies
Downloading dependencies
Installing BMLongPressDragCellCollectionView 3.1.4 (was 3.1.3 and source changed to `https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git` from `https://github.com/CocoaPods/Specs.git`)

[!] Error installing BMLongPressDragCellCollectionView
[!] /usr/bin/git clone https://github.com/liangdahong/BMLongPressDragCellCollectionView.git /var/folders/3n/0yz86qwn3j9gx0hjvwlq37600000gn/T/d20250304-34231-1gpg4gi --template= --single-branch --depth 1 --branch 3.1.4

Cloning into '/var/folders/3n/0yz86qwn3j9gx0hjvwlq37600000gn/T/d20250304-34231-1gpg4gi'...
fatal: unable to access 'https://github.com/liangdahong/BMLongPressDragCellCollectionView.git/': Error in the HTTP2 framing layer

则继续第2步清缓存

2,清缓存

cd 当前项目目录 
rm -rf Pods Podfile.lock  
pod cache clean --all  # 清理项目级缓存 
pod install 

清缓存后pod install成功。

如果还不行就尝试更多的可能的问题解决方案了。我也是先用AI查了有很多可能,但是我另外一个项目正常,说明pod源没啥子问题,网络也没问题,猜测可能是缓存问题。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容