Jonas
Jonas

Reputation: 7885

Firestore: Use of unresolved identifier 'Firestore'

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?

Upvotes: 17

Views: 9461

Answers (7)

Pseudonym Patel
Pseudonym Patel

Reputation: 479

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

Upvotes: 7

Neeraj Jerauld
Neeraj Jerauld

Reputation: 81

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.

Upvotes: 5

darcycrumb
darcycrumb

Reputation: 1

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

Upvotes: 0

Bradley Thomas
Bradley Thomas

Reputation: 4097

Cleaning the build folder fixed this for me

Upvotes: 1

grooveplex
grooveplex

Reputation: 2529

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

Upvotes: 3

Jonas
Jonas

Reputation: 7885

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...

Upvotes: 4

Jake G
Jake G

Reputation: 1195

You need to import it.

Include import FirebaseFirestore at the top of your manager file.

Upvotes: 35

Related Questions