Flutter

cocoa pods 更换源 执行pod install

2019-04-03  本文已影响15人  北方蜘蛛

问题描述:

1 cocoa pods 更换源 执行pod install

出现 :[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master.

You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

2 执行 pod repo add master https://git.coding.net/CocoaPods/Specs.git

出现:[!] To setup the master specs repo, please run pod setup.

image

解决方法:https://github.com/CocoaPods/CocoaPods/issues/4989

Got a temp workaround! Tested with my app and everything is working. This is really only needed if you deleted the master repo. If the master folder is still in your ~/.cocoapods/repos folder with contents then you should be ok to just use pod install --no-repo-update.

And you should be good to go!

So in short, here is the basic list of commands I used:

pod setup (in a separate tab)//打开另一个终端执行pod setup 不要关闭
mv ~/.cocoapods/repos/master/.git ~/tempSpecsGitFolder//回到第一个终端 得到.git文件
^C on pod setup tab//按住ctrl+C 退出
wget https://github.com/CocoaPods/Specs/archive/master.zip//wget下载master.zip
open master.zip (unzipping it)//解压
mv Specs-master ~/.cocoapods/repos/master//修改名称为master
mv ~/tempSpecsGitFolder ~/.cocoapods/repos/master/.git//因为master里面没有.git文件 所以把刚才通过pod setup 生成的.git 文件移过来
cd [project folder]//切换到工程目录
pod install --no-repo-update//执行pod install

还能写东西吗

上一篇下一篇

猜你喜欢

热点阅读