简体   繁体   中英

cannot resolve symbol 'FirebaseFirestore'

So after looking a lot for a solution of this problem, I found a answer in one project on a Github and decide post here. Just add this lines of your class project and going to dismiss the error cannot resolve symbol 'FirebaseFirestore'

import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;

To solve this, please add the following dependencies to your build.gradle file:

implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.google.firebase:firebase-core:16.0.1'

The last dependenciy is now mandatory.

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Don't also forget to add in your top level build.gradle file, the following Google Service plugin:

classpath 'com.google.gms:google-services:4.0.2'

Add this dependencies in your build.gradle

compile 'com.google.firebase:firebase-firestore:17.0.4'

then syn your project.

https://firebase.google.com/docs/firestore/quickstart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM