gpt4 book ai didi

swift - 安装用于 firebase 的 cocoapods 挂起并卡住

转载 作者:行者123 更新时间:2023-11-28 06:41:55 24 4
gpt4 key购买 nike

最近遇到一个问题,好像无法解决。我曾经在我的 swift 项目中使用 pod,并且效果很好。今天,重新尝试使用它来连接到 firebase,这似乎是不可能的。为了解决这个问题,首先,我从我的 mac 中完全删除了 cocoapods,然后重新下载了最新版本。

sudo gem install cocoapods

然后忽略以确保它已完全下载我使用了这个命令

gem list --local | grep cocoapods

结果是

cocoapods (1.0.1)
cocoapods-core (1.0.1)
cocoapods-deintegrate (1.0.0)
cocoapods-downloader (1.0.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.0.0)
cocoapods-try (1.0.0)

然后我创建了一个新的 Xcode 项目并将其命名为“cocoapodsTesting”。然后我执行了 firebase 网站中提到的所有步骤,直到我必须在我的项目上安装 pod 的步骤。所以我去了我的项目目录==>并写了

pod init

然后我打开 pod 文件并将内容更改为:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

target 'cocoapodsTesting' do
pod ‘Firebase’
use_frameworks!

# Pods for cocoapodsTesting

target 'cocoapodsTestingTests' do
inherit! :search_paths
# Pods for testing
end

target 'cocoapodsTestingUITests' do
inherit! :search_paths
# Pods for testing
end

end

然后我使用命令:

pod install 

然后出现了这一行:

Setting up CocoaPods master repo

然后它永远保持不变。然后我关闭我的终端并重新打开它并转到同一目录并使用此命令

pod repo remove master

然后我明白了:

[!] repo master does not exist

Usage:

$ pod repo remove NAME

Deletes the remote named `NAME` from the local spec-repos directory at
`~/.cocoapods/repos/.`

Options:

--silent Show nothing
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command

然后我转到“~/.cocoapods/repos/”。有一个名为 master 的目录,里面什么都没有。

什么也没有发生。

请不要删除我的帖子也不要将其标记为重复,我已经完成了所有其他问题,但我无法完成。请帮我让它工作

最佳答案

  1. pod install,然后如您所见出现了这一行:

    Setting up CocoaPods master repo
  2. 它可能会在那里停留很长时间。

  3. 你可以 cd ~/.cocoapods,如果你怀疑它是否有效,然后每隔几秒 du -sh *。你会看到大小正在变得更大。

    $ du -sh *
    9.7M repos
    $ du -sh *
    14M repos
    $ du -sh *
    20M repos
  4. 等待下载完成,即可正常使用。

对我来说,它是在什么时候完成的

    $ du -sh *
748M repos

关于swift - 安装用于 firebase 的 cocoapods 挂起并卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37724616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com