简体   繁体   English

Android:Cloud Firestore (24.0.2) 中的内部错误

[英]Android: Internal error in Cloud Firestore (24.0.2)

Iam using Firestore 24.0.2, and it was working well, but now i surprised that it is not working, and the app crash when opening MainActivity after Splash Activity.我正在使用 Firestore 24.0.2,它运行良好,但现在我很惊讶它无法正常工作,并且在 Splash Activity 之后打开 MainActivity 时应用程序崩溃。

I tried to remove some dependencies and the problem still exist.我试图删除一些依赖项,但问题仍然存在。

So, After the app run:所以,应用程序运行后:

First -> Splash Screen shown with some code from Firebase RemoteConfig, and it works well.首先- > 显示来自 Firebase RemoteConfig 的一些代码的启动屏幕,它运行良好。

Second -> It moves to Main Activity which has Fragments that use Firestore, after less than one second from show Main Activity, the app crash, with java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.2)第二- >它移动到具有使用 Firestore 的片段的主活动,在显示主活动后不到一秒,应用程序崩溃, java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.2)

I've seen a lot of threads and questions on Stack Overflow, GitHub, and more sites, and no solution worked for me.我在 Stack Overflow、GitHub 和更多网站上看到了很多线程和问题,但没有任何解决方案适合我。

Full Crash Code:完整的崩溃代码:

  java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.2).
        at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:539)
        at com.google.firebase.firestore.util.AsyncQueue$$ExternalSyntheticLambda3.run(Unknown Source:2)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8633)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
     Caused by: java.lang.RuntimeException: android.database.sqlite.SQLiteException: not an error (code 0 SQLITE_OK[0])
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:330)
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$$ExternalSyntheticLambda0.run(Unknown Source:4)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:234)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: android.database.sqlite.SQLiteException: not an error (code 0 SQLITE_OK[0])
        at android.database.sqlite.SQLiteConnection.nativeRegisterLocalizedCollators(Native Method)
        at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:647)
        at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:387)
        at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:226)
        at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:737)
        at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:284)
        at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:251)
        at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:1392)
        at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:1337)
        at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:980)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:444)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:387)
        at com.google.firebase.firestore.local.SQLitePersistence.start(SQLitePersistence.java:138)
        at com.google.firebase.firestore.core.ComponentProvider.initialize(ComponentProvider.java:139)
        at com.google.firebase.firestore.core.FirestoreClient.initialize(FirestoreClient.java:272)
        at com.google.firebase.firestore.core.FirestoreClient.lambda$new$0$com-google-firebase-firestore-core-FirestoreClient(FirestoreClient.java:109)
        at com.google.firebase.firestore.core.FirestoreClient$$ExternalSyntheticLambda17.run(Unknown Source:8)
        at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$2(AsyncQueue.java:441)
        at com.google.firebase.firestore.util.AsyncQueue$$ExternalSyntheticLambda6.call(Unknown Source:2)
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:327)
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$$ExternalSyntheticLambda0.run(Unknown Source:4) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:234) 
        at java.lang.Thread.run(Thread.java:923) 

我只需要恢复到 Firestore 24.0.0,它就停止了。

In my case, I forgot to put await on every Firebase.initializeApp() .就我而言,我忘了在每个Firebase.initializeApp()上都放await

await Firebase.initializeApp(name: 'noPersist', options: options);

await Firebase.initializeApp();
FirebaseDatabase.instance.setPersistenceEnabled(true);

As of today i ran into this issue and solved it by adding this little block of code to my andriod/app/build_gradle截至今天,我遇到了这个问题并通过将这个小代码块添加到我的 andriod/app/build_gradle 来解决它

release { signingConfig signingConfigs.release shrinkResources false minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }发布 { signingConfig signingConfigs.release shrinkResources false minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }

I have tried many available answers like disable minify enable as false, which in not a right approach.我尝试了许多可用的答案,例如将禁用缩小启用为假,这不是正确的方法。 Adding a line in pro-guard finally resolved the issue after 2 days of hard work.经过2天的努力,在pro-guard中添加一行终于解决了这个问题。

-keep class io.grpc.** {*;} -保留 class io.grpc.** {*;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter:Android 中的 Cloud Firestore (24.2.2) 内部错误 - Flutter: Internal error in Cloud Firestore (24.2.2) in Android Android 中的云 Firestore 的离线持久性 - Offline persistance with cloud firestore in Android 错误:@firebase/firestore: Firestore (9.6.11): 无法到达 Cloud Firestore 后端 - Error: @firebase/firestore: Firestore (9.6.11): Could not reach Cloud Firestore backend 连接到 firebase/firestore 时出错:无法到达 Cloud Firestore 后端 - Error when connecting to firebase/firestore: Could not reach Cloud Firestore backend 新项目的 Cloud Firestore 默认位置错误 - Cloud Firestore default location error on new project 从 Cloud Firestore 数据库检索数据时出错 - Error retrieving data from Cloud Firestore database Cloud Functions - Cloud Firestore 错误:无法获取 serverTimestamp - Cloud Functions - Cloud Firestore error: can't get serverTimestamp Android:Paging3 使用 cloud-firestore 创建远程中介 - Android: Paging3 create remotemediator with cloud-firestore android - 如何在 RecyclerView 中显示来自 Cloud FireStore 的 object 数组 - android - how to display the array of object from Cloud FireStore in the RecyclerView 我在导入 cloud_firestore 时出错 - I am having an error upon importing cloud_firestore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM