我正在使用 Xcode 8.3.3。
我正在尝试为 IOS 推送通知安装 firebase pod,但无法通过“pod install”命令。 “接收对象”卡在 - 看起来像是 - 随机百分比。
这是终端输出的样子:
Mac-Admin:MKR Medwe$ pod install --verbose
Preparing
Setting up CocoaPods master repo
Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1447009, done.
remote: Compressing objects: 100% (315/315), done.
Receiving objects: 12% (183211/1447009), 36.09 MiB | 2.11 MiB/s
我试过取消并重新启动,但这也无济于事。
等待大约 30 分钟后,我收到此错误:
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
(/usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1447009, done.
remote: Compressing objects: 100% (315/315), done.
error: RPC failed; curl 56 SSLRead() return error -9806.11 MiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
)
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
如错误所示,我已尝试手动添加有问题的“主”源。但是我遇到了和以前一样的问题。大约 20-30 分钟后也会出现相同的错误。
[编辑] 这是我的 Podfile:
platform :ios, '10.3'
target 'MKR' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'MKRTests' do
inherit! :search_paths
end
target 'MKRUITests' do
inherit! :search_paths
end
end
最佳答案
遗憾的是,我无法让 cocoa pod 方法发挥作用。但是手动安装框架对我来说很管用。
由于 Firebase 页面上的解释有点草率,我依赖这篇博文:http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/
该帖子提供了非常详尽的解释!它没有解决 git/cocoa pods 问题,但确实解决了最初的问题。
关于ios - “pod install”卡在 'Receiving Objects',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45526503/