我试图用pod安装命令更新现有的pod,但它需要很长时间才能运行。

verbose模式显示它被卡在下一行(永远)

更新规范回购主机 $ /usr/bin/git pull -no-rebase -no-commit

在它被卡住之后就没有网络活动了。


当前回答

我也有同样的问题,然后我意识到我仍然在“非常糟糕的网络”上运行网络调节器。把它关掉就解决了问题。

希望这能帮助到别人。

其他回答

找到了另一种下载cocoapods的方法,就是下载这里提供的快照之一。它有点旧,但是.bz2压缩文件下载起来要快得多。一旦我下载了它,我将它复制到~/。cocoapods/repos/然后我使用bzip2 -dk *.bz2解压缩它。

解压缩需要一段时间,完成后,我将新解压缩文件的扩展名更改为.tar,并执行tar xvf *.tar来解压缩。这将显示正在创建的文件列表,也需要一段时间。

Finally when I ran pod repo list while inside the project folder, it showed the master folder had been added as a repo. Because I still kept getting an error that it was unable to find the specification for the pod I was looking for, I went to the master folder and did git fetch and then git merge. The git fetch took the longest, about an hour at 50 KB/s. I used fetch and merge instead of pull, as I was having issues with it, i.e. fatal: the remote end hung up unexpectedly. It is now up to date and I was able to get the pod I wanted.

2019年11月为我解决

你好,我尝试了很多东西,但没有工作。试着连接到这个网站https://cdn.cocoapods.org/如果你不能使用VPN和做pod安装等。不要忘记使用verbose来理解正在发生的事情。

就连我也这么想。如果你打开Activity Monitor,你可以看到它正在以GIT的名字下载一些东西。

我发现这个技巧很有用。

https://stackoverflow.com/a/21916507/563735

我找到了另一种解决问题的方法

Pod安装——冗长——不重新更新

这对我很管用。

在花了半天的时间来研究为什么分析依赖关系总是这么久之后,我发现我正在安装最新的Firebase pod(7.1.0),它依赖于GoogleAppMeasurement 7.1.0版本,还有另一个pod,这是一个广告中介框架,其中包括Google-Mobile-Ads-SDK。这个SDK依赖于GoogleAppMeasurement的低得多的版本~ 6.0。 我可以通过从广告中介中注释掉冲突的pod来安装这些pod。 就像这样:

# Ad network framework
  pod 'SomeMediationNetwork/Core'
#  pod 'SomeMediationNetwork/GoogleMobileAds' # - the conflicting pod
  pod 'SomeMediationNetwork/Facebook'
  pod 'SomeMediationNetwork/SmartAdServer'
  pod 'SomeMediationNetwork/Mopub'

我不得不联系广告中介库出版商来解决这个问题,很可能是通过更新到最新的Google-Mobile-Ads-SDK pod并发布一个新版本。

我希望这篇文章能帮助到那些正在碰壁的人