Beginning Firebase - Part 2: Installing Firebase | Ray Wenderlich

In this video, you'll learn how to install Firebase into your app by way of the dependency management framework, CocoaPods.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4203-beginning-firebase/lessons/2
1 Like

Normally, using CocoaPods, I just do Pod init to create the podfile. Why didnā€™t you do that, and why do you not include use_frameworks! in your podfile?
Confusedā€¦

@vegetarianzombie Could you please help with this when you get a chance? Thank you - much appreciated! :]

I did that to show the end user how to create a podfile from scratch. Did you run into any issues when installing firebase?

Nope. No issues apart from Xcode 9 beta 6 not copying over the plist file from my download location (see thread in that topic for video 3)
I am wondering then, why I my podfile which looks like this works. Notice I have not commented out use_frameworks!
Even Google recommends that you use pod init to create the podfile. I just edit it using Xcode.

# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'

target 'Grocr' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Grocr
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'

end

Ah - thanks for the heads up. Iā€™ll update the video to have the Google reccommeneded instructions. I appreciate you letting me know!

After installing Firebase and adding ā€˜import Firebaseā€™ to GroceryItem.swift, I had to update DatabaseReference to FIRDatabaseReference and DataSnapshot to FIRDataSnapshot to get it to compile/work.

Didnā€™t have to do this from the Final project so I must have missed something along the way.

Resolved - I had an old version of Firebase for some reason.

The same thing happened to me, so I donā€™t think you missed anything.

Maybe CocoaPods is installing in older version of Firebase? Iā€™m still looking into the issue.

Yep, verified that when going through the tutorial, the Firebase version that gets installed is v3.6.0. The final project for ā€œPart 2ā€ uses Firebase 4.0.3

Not sure why CocoaPods is picking an old versionā€¦

Outdated CocoaPod repoā€¦

Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.

So, if you do the ā€œpod installā€ step, and you still have the 2 build errors, run
pod update
from the terminal. This will update your pod repo on your system, and also update the Firebase versions to what they should be.

Hope this helps!

Brent

Awesome, thank you for the heads up on the fix Brent!

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.

@vegetarianzombie Hey Brian, I have a question: Iā€™m trying to install this for iOS 12, so that is the only change I make in the textEditor (vim) [platform :ios, ā€˜12.0ā€™].
But I still get an error that somehow indicates the word ā€œendā€ and the front-slashes [pod ā€˜Firebase**/**ā€¦ā€™ are erroneous!

I cannot find another tutorial to fix this, so how do I go about this?

Thanks!

edit: here is the error

[!] Invalid Podfile file: syntax error, unexpected keyword_end, expecting end-of-input.

from /Users/r.0/Desktop/Grocr/Podfile:9

-------------------------------------------

end

-------------------------------------------

xyz-MacBook-Pro:Grocr r.0$

@bdmoakley Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hello! Has this course been refreshed for iOS 13?

@bobiq11 Thank you for your suggestion - much appreciated! I will forward it to the video team.