简体   繁体   中英

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.

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.

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)

I've seen a lot of threads and questions on Stack Overflow, GitHub, and more sites, and no solution worked for me.

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

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

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

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

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