Cocoapods pod install报错

[!] CDN: trunk Repo update failed - 32 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/8/5/c/mob_sharesdk/0.0.1/mob_sharesdk.podspec.json Response: Couldn't connect to server

解决办法,在podfile里面添加:

source ‘https://github.com/CocoaPods/Specs.git’
target 'Runner' do

但是由于网络不好一直会卡在Cloning spec repo cocoapods from https://github.com/CocoaPods/Specs.git

解决办法:
1、直接去https://github.com/CocoaPods/Specs下载
2、下载完成后,修改下载下来文件夹的名字为master
3、commond+G打开路径~/.cocoapods/repos,替换里边的master文件夹
4、打开终端
5、终端输入命令: cd master文件的路径
6、终端输入命令:git init
7、终端输入命令:git remote add origin https://github.com/CocoaPods/Specs.git
8、终端输入命令:pod repo,如果成功出现入下图所示:

截屏2021-06-16 下午2.02.27.png

9、接下来继续pod install 就会成功了

你可能感兴趣的:(Cocoapods pod install报错)