Let db = Firestore.firestore() issue

Hi Chris and Team, thanks for your videos so far. I faced a issue, however, during the firestorm tutorial series.

import UIKit
import Firebase

class ViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
}
let db = Firestore.firestore()

}

This is my code, yet on the line let db = Firestore.firestore(), it says use of unresolved identifier 'Firestore’

I have added the FirebaseApp.configure and import Firebase at the start. I also followed all instructions in the lessons.

I also tried the Solution to this problem in another thread which is “import FireStoreFirebase” but it still has that error. Any idea why it has use of unresolved identifier? Thanks! Any help would be deeply appreciated!

Hi,

Colin Walsh1 month ago

I experienced the same problem, it looks like the set of instructions given by Firebase has changed since the video was made and now only instructs for the installation of pod ‘Firebase/Analytics’. I was able to resolve this by closing out of xcode, opening the Podfile and adding pod ‘Firebase/Auth’ and pod ‘Firebase/Firestore’ in addition to the pod ‘Firebase/Analytics’ that i already had. After doing so you can relaunch your terminal and once again execute pod install in your project folder. Once these have successfully installed relaunch your project using the .xcworkspace file and then inside the project hit command R to rebuild it with the new pods. This should fix it, best of luck

this is taken from a YouTube comment. It worked for me