14

Fairly new to iOS development and have some had some trouble installing firebase into my iOS application. Essentially what the application will do is take information about trails around the country from a firebase database, this information is to be output to a tableview which will allow users to select one of the trails and answer some questions about the trail.

While attempting to install the application I went through the steps which are outlined on the google site for "add firebase to your iOS app". The first stages went all fine without a hitch until I encountered stage 4.

When I enter import Firebase into the app.delegate file, I receive an error: Error on import Firebase in app.delegate file

On top of this, I now have another error which is preventing me from building the application, this is the error:

Linker command failed error, prevents application from building

Essentially, I need to know if I am making any glaring errors, which I probably am as I'm new to this, and also how to resolve these issues if possible.

Thanks.

adjash
  • 173
  • 1
  • 1
  • 10
  • the error is due to missing files mentioned with the yellow caution icon above the error in the screenshot – sanjaykmwt May 24 '18 at 12:30
  • @sanjaykmwt , Do you know how I can get these files? Sorry if this is a stupid question I'm really new to iOS development – adjash May 24 '18 at 12:39
  • Did you install Firebase dependencies in your Podfile ? – AnthonyR May 24 '18 at 13:32
  • 1
    You have to open `.xcworkspace` file in the xCode after installing the pod. I've got the similar error if `.xcodeproj` is opened. – Renatus May 24 '18 at 13:33

3 Answers3

11

Make sure you're opening the .xcworkspace and not the .xcproject file in Xcode. Close the project and open .xcworkspace

3

First Install FireBase properly via CocoaPods. Try the following steps

Step 1 - Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).

Step 2 - Clear your derived data. You can find your derived data in here

~/Library/Developer/Xcode/DerivedData

Step 3 - Open your .xcworkspace, Not .xcproject

Step 4 - Clean your project by pressing ⌘+Shift+K keys

Step 5 - Build your project by pressing ⌘+B keys

Faiz Fareed
  • 1,498
  • 1
  • 14
  • 31
0

I've found an answer to this issue.

First, you need to remove your derived data from your project so apply Faiz's solution above.

Then, Go to your Targets -> Build settings -> Search "Other Linker Flags". Remove any links to your pods in your project here.

Reinstall required pods. This will refresh your pods in your project.

alidinc
  • 51
  • 6