简体   繁体   English

Firebase SDK Pod安装链接器错误

[英]Firebase SDK pod installation linker error

I wanted to implement Firebase SDK in my Swift project. 我想在我的Swift项目中实现Firebase SDK。 I followed the instructions and installed pods, created a Podfile as follows: 我按照说明进行操作并安装了pod,并按如下所示创建了Podfile:

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

Then as I do install pods , it comes out with the following in terminal: 然后,当我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.

So I thought it worked but after reading various posts online apparently this is supposed to produce a xcworkspace file which I'm supposde to use instead of xcodeproj - is that correct? 因此,我认为它可以工作,但是在网上阅读各种文章之后,显然应该产生一个我应该代替xcodeproj使用的xcworkspace文件-对吗? And if so why hasn't it generated it? 如果是这样,为什么还没有生成呢? I don't understand what is going wrong. 我不明白怎么了。

It might also be relevant info that I added all the bits to my xcodeproj file (before realising I should be working with xcworkspace instead) so the pods had come up in my xcodeproj , I added the import Firebase header file , the Google service info, plist and the import+ FIRApp.configure() in delegate and added $(inherited) in other linkers and when I try to use simulator it comes up with an error saying: 可能也有相关的信息,我将所有位都添加到了xcodeproj文件中(在意识到我应该使用xcworkspace之前),以便在我的xcodeproj添加了pod,我添加了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). 

How come it allowed me to do all this if the initial install was incorrect? 如果初始安装不正确,它怎么允许我执行所有这些操作? And where do I go from here? 那我从哪里去呢?

Can I please get some help about what is going wrong? 请问有什么问题可以帮我吗? And how can I solve this problem? 我该如何解决这个问题? Or at least am I able to go back to step one and reverse all these changes smoothly? 或者至少我可以返回到第一步并平稳地撤消所有这些更改?

If possible please use examples, I am a newbie. 如果可能,请使用示例,我是新手。

Incase someone else is having this error. 如果其他人遇到此错误。 The problem was that I was in the wrong directory and had attempted to put a Podfile with the directory leading to 'MyApp.xcodeproj'. 问题是我位于错误的目录中,并试图将Podfile与指向“ MyApp.xcodeproj”的目录放置在一起。 This is incorrect as the Podfile should just be in the folder. 这是不正确的,因为Podfile应该只在文件夹中。 Initially I was not able to locate this folder (even though it was on my Desktop) so I used in terminal: 最初,我无法找到此文件夹(即使它位于我的桌面上),因此我在终端机中使用了:

cd ~/Desktop then cd〜/ Desktop然后
cd ~/Desktop/MyApp and then pod init and edited the Podfile followed by pod install... cd〜/ Desktop / MyApp,然后进行pod init并编辑Podfile,然后安装pod ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM