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源沒啥子問題,網絡也沒問題,猜測可能是緩存問題。