17

I wanted to implement the Firestore Database. In my Podfile I added pod 'Firebase/Firestore' and did pod install. When trying to use let db = Firestore.firestore()I get the Error:Use of unresolved identifier 'Firestore'. I have tried pod update too and it also says Using FirebaseFirestore (0.12.2) but it soll doesn't work. What should I do?

Jonas
  • 7,089
  • 15
  • 49
  • 110

7 Answers7

35

You need to import it.

Include import FirebaseFirestore at the top of your manager file.

Jake G
  • 1,185
  • 9
  • 19
  • 1
    I get `No such module 'FirebaseFirestore'` there as well. Before I had `import Firebase` and this works. But somehow Firestore does not. Also I find it suspicious that it in my terminal it says `Using FirebaseFirestore (0.12.2)` while the other Firebase imports are 5.0.x. – Jonas Jun 05 '18 at 19:33
  • 2
    I find it strange that Google couldn't tell us this. https://firebase.google.com/docs/firestore/quickstart – Jeff Aug 12 '18 at 17:25
7

I had to add pod 'Firebase/Firestore' to the podfile and then reinstall the podfile.

Pseudonym Patel
  • 469
  • 7
  • 16
5

If my guess is right. pod 'Firebase/Firestore' was installed after appname.xcworkspace was created by already installing pod once. One solution is to remove all these ****appname.xcworkspace, ****Podfile.Lock, ****Pods Folder and install pod once more. it should work.

4

I solved the problem following this: https://stackoverflow.com/a/44486792/9547658

I don't know why it didn't worked in the first place but now it works...

Jonas
  • 7,089
  • 15
  • 49
  • 110
3

Using var db: Firestore! instead of var db: FireStore! worked for me.

grooveplex
  • 2,492
  • 4
  • 28
  • 30
1

Cleaning the build folder fixed this for me

Bradley Thomas
  • 4,060
  • 6
  • 33
  • 55
0

This did it for me, add pod 'Firebase/Firestore' to the podfile and import FirebaseFirestore

Credit to Pseudonym Patel https://stackoverflow.com/a/53434443/12088138