[英]Flutter: Internal error in Cloud Firestore (24.2.2) in Android
[英]Android: Internal error in Cloud Firestore (24.0.2)
我正在使用 Firestore 24.0.2,它運行良好,但現在我很驚訝它無法正常工作,並且在 Splash Activity 之后打開 MainActivity 時應用程序崩潰。
我試圖刪除一些依賴項,但問題仍然存在。
所以,應用程序運行后:
首先- > 顯示來自 Firebase RemoteConfig 的一些代碼的啟動屏幕,它運行良好。
第二- >它移動到具有使用 Firestore 的片段的主活動,在顯示主活動后不到一秒,應用程序崩潰, java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.2)
我在 Stack Overflow、GitHub 和更多網站上看到了很多線程和問題,但沒有任何解決方案適合我。
完整的崩潰代碼:
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,它就停止了。
就我而言,我忘了在每個Firebase.initializeApp()
上都放await
。
await Firebase.initializeApp(name: 'noPersist', options: options);
await Firebase.initializeApp();
FirebaseDatabase.instance.setPersistenceEnabled(true);
截至今天,我遇到了這個問題並通過將這個小代碼塊添加到我的 andriod/app/build_gradle 來解決它
發布 { signingConfig signingConfigs.release shrinkResources false minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }
我嘗試了許多可用的答案,例如將禁用縮小啟用為假,這不是正確的方法。 經過2天的努力,在pro-guard中添加一行終於解決了這個問題。
-保留 class io.grpc.** {*;}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.