gpt4 book ai didi

android - Android 上的 Flutter Cloud Firestore 崩溃 - 空对象引用上的 Mutable Document.getKey()

转载 作者:行者123 更新时间:2023-12-04 23:49:24 27 4
gpt4 key购买 nike

我一直在为使用 Cloud Firestore 的 Flutter 应用程序崩溃而苦苦挣扎。在应用程序的初始加载序列期间,它会尝试从 Firestore 缓存数据中加载一些数据。这会导致应用程序完全崩溃,似乎在 Cloud Firestore 的 Android 实现中。抛出以下错误:

D/AndroidRuntime(20609): Shutting down VM
E/AndroidRuntime(20609): FATAL EXCEPTION: main
E/AndroidRuntime(20609): Process: com.app, PID: 20609
E/AndroidRuntime(20609): java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.1).
E/AndroidRuntime(20609): at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:539)
E/AndroidRuntime(20609): at com.google.firebase.firestore.util.-$$Lambda$AsyncQueue$cG4e8FKiBI1uHuEBYC-bY9JR88Y.run(Unknown Source:2)
E/AndroidRuntime(20609): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(20609): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(20609): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(20609): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(20609): at android.app.ActivityThread.main(ActivityThread.java:8633)
E/AndroidRuntime(20609): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20609): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
E/AndroidRuntime(20609): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/AndroidRuntime(20609): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.firestore.model.DocumentKey com.google.firebase.firestore.model.MutableDocument.getKey()' on a null object reference
E/AndroidRuntime(20609): at com.google.firebase.firestore.model.mutation.MutationBatch.applyToLocalView(MutationBatch.java:117)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.LocalDocumentsView.recalculateAndSaveOverlays(LocalDocumentsView.java:164)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.LocalDocumentsView.recalculateAndSaveOverlays(LocalDocumentsView.java:195)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.LocalStore.lambda$acknowledgeBatch$3$LocalStore(LocalStore.java:310)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.-$$Lambda$LocalStore$HWVzpgIBWnr-aRwD_W4TqGD4S0s.get(Unknown Source:4)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.SQLitePersistence.runTransaction(SQLitePersistence.java:228)
E/AndroidRuntime(20609): at com.google.firebase.firestore.local.LocalStore.acknowledgeBatch(LocalStore.java:301)
E/AndroidRuntime(20609): at com.google.firebase.firestore.core.SyncEngine.handleSuccessfulWrite(SyncEngine.java:440)
E/AndroidRuntime(20609): at com.google.firebase.firestore.core.MemoryComponentProvider$RemoteStoreCallback.handleSuccessfulWrite(MemoryComponentProvider.java:109)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.RemoteStore.handleWriteStreamMutationResults(RemoteStore.java:666)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.RemoteStore.access$500(RemoteStore.java:53)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.RemoteStore$2.onWriteResponse(RemoteStore.java:201)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.WriteStream.onNext(WriteStream.java:185)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.WriteStream.onNext(WriteStream.java:49)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.lambda$onNext$1$AbstractStream$StreamObserver(AbstractStream.java:119)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.-$$Lambda$AbstractStream$StreamObserver$agoqqrRAMtj_xK6Rj8UhjstJJXs.run(Unknown Source:4)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.AbstractStream$CloseGuardedRunner.run(AbstractStream.java:67)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.onNext(AbstractStream.java:110)
E/AndroidRuntime(20609): at com.google.firebase.firestore.remote.FirestoreChannel$1.onMessage(FirestoreChannel.java:131)
E/AndroidRuntime(20609): at io.grpc.internal.DelayedClientCall$DelayedListener.onMessage(DelayedClientCall.java:447)
E/AndroidRuntime(20609): at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:656)
E/AndroidRuntime(20609): at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:641)
E/AndroidRuntime(20609): at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
E/AndroidRuntime(20609): at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
E/AndroidRuntime(20609): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
E/AndroidRuntime(20609): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(20609): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
E/AndroidRuntime(20609): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(20609): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(20609): at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:234)
E/AndroidRuntime(20609): at java.lang.Thread.run(Thread.java:920)
I/Process (20609): Sending signal. PID: 20609 SIG: 9
清除应用程序数据将解决此问题,应用程序将再次启动。但是,经过一段时间的使用后,该应用程序将再次在启动时开始崩溃。这让我相信正在从 Firestore 加载一条数据,当应用程序尝试处理该数据时,会导致此崩溃。
我有点茫然地弄清楚为什么会发生这种崩溃 - 有没有人有任何见解或信息?

最佳答案

这是 Firebase SDK 中的一个问题,已经修复,等待合并到 FlutterFire .您可以跟踪问题状态here ,以及 PR 本身 here .

关于android - Android 上的 Flutter Cloud Firestore 崩溃 - 空对象引用上的 Mutable Document.getKey(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71093570/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com