简体   繁体   中英

Firebase SDK pod installation linker error

I wanted to implement Firebase SDK in my Swift project. I followed the instructions and installed pods, created a Podfile as follows:

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:

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? 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:

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'. This is incorrect as the Podfile should just be in the folder. 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/MyApp and then pod init and edited the Podfile followed by pod install...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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