Firebase SDK pod 安装链接器错误

Firebase SDK pod installation linker error

我想在我的 Swift 项目中实施 Firebase SDK。我按照说明安装了 pods,创建了一个 Podfile,如下所示:

platform :ios, '7.0'
target 'MyApp' do
pod 'Firebase'
project '/Users/MyName/Desktop/MyApp/MyApp.xcodeproj'
end

然后正如我所做的那样install pods,它在终端中出现以下内容:

Analyzing dependencies
Downloading dependencies
Using Firebase (3.9.0)
Using FirebaseAnalytics (3.5.1)
Using FirebaseCore (3.4.4)
Using FirebaseInstanceID (1.0.8)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 7 total pods installed.

所以我认为它有效,但在阅读了各种在线帖子后,显然这应该会生成一个 xcworkspace 文件,我应该使用它而不是 xcodeproj- 对吗?如果是这样,为什么它没有生成它?我不明白这是怎么回事。

这也可能是相关信息,我将所有位添加到我的 xcodeproj 文件中(在意识到我应该使用 xcworkspace 之前)所以 pods 出现了在我的 xcodeproj 中,我在委托中添加了 import Firebase header file、Google 服务信息、plist 和 import+ FIRApp.configure(),并在其他链接器中添加了 $(inherited),当我尝试使用模拟器会出现错误提示:

Library not found for GoogleToolBoxForMac
Linker command code failed with exit code 1 (use -v to see invocation). 

如果初始安装不正确,为什么它允许我执行所有这些操作?我从这里去哪里?

我能得到一些关于出了什么问题的帮助吗?我该如何解决这个问题?或者至少我能回到第一步并顺利地逆转所有这些变化吗?

可能的话请举个例子,我是新手

以防其他人遇到此错误。问题是我在错误的目录中,并试图将 Podfile 与指向 'MyApp.xcodeproj' 的目录放在一起。这是不正确的,因为 Podfile 应该就在文件夹中。最初我找不到这个文件夹(即使它在我的桌面上)所以我在终端中使用:

cd ~/桌面 然后
CD~/Desktop/MyApp 接着 吊舱初始化 并编辑了 Podfile,然后是 pod 安装...