https://firebase.google.com/support/rel ... es/android
Build.gradle.kts содержит:
Код: Выделить всё
plugins {
id("com.android.application") version "8.6.0"
id("org.jetbrains.kotlin.android") version "1.9.25"
id("com.google.gms.google-services") version "4.4.2"
}
dependencies {
// Firebase dependencies
implementation(platform("com.google.firebase:firebase-bom:33.3.0"))
implementation("com.google.firebase:firebase-auth:23.0.0")
implementation("com.google.firebase:firebase-firestore:25.1.0")
}
Код: Выделить всё
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
id("com.google.gms.google-services") version "4.4.2" apply false
}
Код: Выделить всё
fun checkWhitelistByEmail(
email: String,
onAccessGranted: () -> Unit,
onAccessDenied: () -> Unit,
scope: CoroutineScope // Pass the coroutine scope from outside
) {
val db = Firebase.firestore
// val db = FirebaseFirestore.getInstance()
Log.d("FirestoreCheck", "Firestore instance initialized")
db.collection("whitelisted_users")
.get()
.addOnSuccessListener { result ->
for (document in result) {
Log.d("FirestoreCheck", "${document.id} => ${document.data}")
}
}
.addOnFailureListener { exception ->
Log.w("FirestoreCheck", "Error getting documents.", exception)
}
}
Код: Выделить всё
FATAL EXCEPTION: main (Ask Gemini)
Process: com.flashc_ai.FlahsC_AI, PID: 5439
java.lang.RuntimeException: Internal error in Cloud Firestore (25.1.0).
at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:546)
at com.google.firebase.firestore.util.AsyncQueue$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: com.google.android.gms.tasks.RuntimeExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Lio/grpc/InternalGlobalInterceptors;
at com.google.android.gms.tasks.zzw.getResult(com.google.android.gms:play-services-tasks@@18.1.0:3)
at com.google.firebase.firestore.remote.FirestoreChannel.lambda$runBidiStreamingRpc$0$com-google-firebase-firestore-remote-FirestoreChannel(FirestoreChannel.java:146)
Есть идеи, как это можно организовать, я действительно застрял с этой ошибкой уже несколько дней, и ничего не работает, несмотря ни на что. что я пробую. Обратите внимание, что firebaseAuth работает нормально, поэтому настройки соединения в порядке.
Спасибо!
Я попробовал указать версии импортируемых модулей, попытался упростить код, чтобы проверить концепция...
Подробнее здесь: https://stackoverflow.com/questions/790 ... connection
Мобильная версия