Firestore:脱机时事务崩溃 [英] Firestore: Transactions crashing when offline

查看:135
本文介绍了Firestore:脱机时事务崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道根据变更日志(0.12.9 + 5)。据推测,它修复了Android设备上的崩溃问题,该问题导致在离线状态下尝试 Transaction 会导致应用程序崩溃。但是,即使使用0.13.7(我正在使用的版本)。我仍然遇到应用崩溃的问题。控制台中没有错误日志(只是立即崩溃)。

I am aware that according to the changelog (0.12.9+5). It supposedly fixed a crash on android where Transactions attempted while offline would result in an app crash. However, even with 0.13.7 (the version I'm using). I'm still running into app crashes. There is no error log in the console (just immediate crash).

我已经尝试过:


  1. 运行我的物理设备上处于调试模式的应用程序(行为相同)

  2. 附加错误句柄回调(未调用)

  3. 降低我的 cloud_firestore 版本降至0.12.11(在查询中支持 whereIn 的最低版本;这是我需要的,并且高于0.12.9 + 5)

  1. Running my app in debug mode on a physical device (same behavior)
  2. Attaching error handle callback (not called)
  3. Lowering my cloud_firestore version down to 0.12.11 (the lowest version that supported whereIn in querying; it is something I needed and above 0.12.9+5)

其他可能相关的信息:


  1. Logcat(我包括了一些我可以远程猜测这是相关的;我不知道如何阅读logcat)


 java.lang.RuntimeException: An error occurred while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:354)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
        at java.util.concurrent.FutureTask.run(FutureTask.java:271)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.AssertionError: INTERNAL ASSERTION FAILED: A transaction object cannot be used after its update callback has been invoked.
        at com.google.firebase.firestore.util.Assert.fail(com.google.firebase:firebase-firestore@@21.3.0:46)
        at com.google.firebase.firestore.util.Assert.hardAssert(com.google.firebase:firebase-firestore@@21.3.0:31)
        at com.google.firebase.firestore.core.Transaction.ensureCommitNotCalled(com.google.firebase:firebase-firestore@@21.3.0:246)
        at com.google.firebase.firestore.core.Transaction.lookup(com.google.firebase:firebase-firestore@@21.3.0:81)
        at com.google.firebase.firestore.Transaction.getAsync(com.google.firebase:firebase-firestore@@21.3.0:191)
        at com.google.firebase.firestore.Transaction.get(com.google.firebase:firebase-firestore@@21.3.0:228)
        at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$5.doInBackground(CloudFirestorePlugin.java:569)
        at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$5.doInBackground(CloudFirestorePlugin.java:564)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 





2020-06-20 15:20:03.272 10188-10241/com.vnf.lightweight_pos E/CloudFirestorePlugin: java.lang.Exception: DoTransaction failed: UNAVAILABLE: Unable to resolve host firestore.googleapis.com





     Caused by: java.lang.AssertionError: INTERNAL ASSERTION FAILED: A transaction object cannot be used after its update callback has been invoked.





Channel is unrecoverably broken and will be disposed!



  1. firebase_auth :0.16.1

  1. firebase_auth: 0.16.1


推荐答案

我发现了 GitHub问题,它描述了您完全相同的问题。

同时,根据

I have found a GitHub issue that describes your exact same problem. There's a pending fix for this matter.

rel = nofollow noreferrer>此评论最好的方法似乎是降级到0.12.10 + 2版本。

In the meantime, according to this comment the best approach seems to be downgrading to version 0.12.10+2.

这篇关于Firestore:脱机时事务崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆