[英]Cannot resolve FirebaseFirestore Android
這一切都暗示着,該工件尚未下載......
檢查 Gradle 是否未處於離線模式; 並同步或構建項目一次。
或者,從終端運行./gradlew clean assembleDebug
。
存儲庫mavenCentral()
也比mavenLocal()
相關。
而這些工件的存儲庫應該是google()
一個。
另一個已知問題是,在gradle.properties
文件中,人們可能不得不更喜歡 IPv4:
org.gradle.jvmargs=-Djava.net.preferIPv4Stack=true
嘗試關閉您的項目並重新導入
嘗試這個:-
我最近遇到了那個錯誤,這是我嘗試過的步驟,我不太確定其中哪一個可以解決問題,但錯誤已解決,我能夠使用 fireStore。 這些沒有任何順序我只是隨機地繼續做這些。
我希望這些有幫助。 檢查這些
1. 您是否安裝了 Google Play Services 和 Google Repository。
檢查更新版本並安裝它(如果可用)。
2. 嘗試匹配gradle 配置中的所有版本: app ... 例如,
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-firestore:16.0.3'
多次同步這些文件
3.清除緩存並重啟Android Studio IDE
第 1 步:- 轉到文件菜單 > 使緩存無效/重新啟動..
第 2 步:- 在出現的窗口上單擊無效並重新啟動這將重新啟動項目並重建它,保持冷靜,因為這可能需要相當長的時間。
遵循這些步驟后,我的所有錯誤都解決了,我能夠實例化 FirebaseFirestore。
項目 build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}}
嘗試將其添加到您的 gradle 中
FirestoreRecyclerAdapter 類是 FirebaseUI 庫的一部分,但不是核心 Firestore SDK
implementation 'com.firebaseui:firebase-ui-firestore:4.3.1'
我最近遇到了這個問題。 有一個簡單的解決方案。
將此添加到您的應用程序 gradle implementation 'com.google.android.gms:play-services-base:15.0.1' implementation 'com.firebaseui:firebase-ui-firestore:4.3.1'
導入以下語句 import com.google.firebase.firestore.FirebaseFirestore;
晚點再謝我 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.