Repository navigation
[cloud_firestore] Crash "An error occurred while executing doInBackground()" #70
Description
Activity
creativecreatorormaybenot commented
on Sep 2, 2019 ContributorAuthorMore actionsAnother "version" of this crash:
Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done + 353(AsyncTask.java:353) at java.util.concurrent.FutureTask.finishCompletion + 383(FutureTask.java:383) at java.util.concurrent.FutureTask.setException + 252(FutureTask.java:252) at java.util.concurrent.FutureTask.run + 271(FutureTask.java:271) at android.os.AsyncTask$SerialExecutor$1.run + 245(AsyncTask.java:245) at java.util.concurrent.ThreadPoolExecutor.runWorker + 1162(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run + 636(ThreadPoolExecutor.java:636) at java.lang.Thread.run + 764(Thread.java:764) Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.firestore.ak com.google.firebase.firestore.ak.a(com.google.firebase.firestore.d, java.lang.Object)' on a null object reference at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$7.doInBackground + 20(CloudFirestorePlugin.java:20) at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$7.doInBackground + 2(CloudFirestorePlugin.java:2) at android.os.AsyncTask$2.call + 333(AsyncTask.java:333) at java.util.concurrent.FutureTask.run + 266(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run + 245(AsyncTask.java:245) at java.util.concurrent.ThreadPoolExecutor.runWorker + 1162(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run + 636(ThreadPoolExecutor.java:636) at java.lang.Thread.run + 764(Thread.java:764)I think adding all the devices it occured on is not useful here, but I can do that if it helps.
creativecreatorormaybenot commented
on Sep 2, 2019 ContributorAuthorMore actionsI looked at where
doInBackgroundis used, I can say that I useTransaction#set/update/getbut neverdelete. I have no idea what part of my Dart code is causing these issues.Luckily this crash happens a lot in Play Store pre-launch reports and seeing that this happens right after start up when first loading content (UI is already displayed), I think it can only be
Transaction#set.Update: I suppose what I described here could be #79.
The `transaction.set` calls I am looking at use `FieldValue.serverTimestamp()`, so maybe it has something to do with multiple of these transactions piling up? Reason I say this: Sometimes, I see my app crash when there is bad connection and I try to perform an action like "incrementing a value", which is a transaction, and if the bad connection causes the transaction to not update the value (immediately), I will trigger it again manually, and again and after some of these actions "pile" up, the app will crash - so I imagine that this issue is **similar** or that one of these stack traces actually is exactly what I described.Most likely it is what I can see in pre-launch recordings: right after start up with
Transaction#set's that haveFieldValue.serverTimestamp().I cannot replicate it in debug mode (probably because I have a stable connection?) and it does not happen to every user, i.e. just a few percent.
Reacted by Rachit Rawat- locked and limited conversation to collaborators
on Aug 20, 2020
I have the feeling that the issue (flutter/flutter#37569) is getting lost in the old repo.
I am seeing this on a lot of different devices now. Frequently saw this in pre-launch reports on the Play Store before (mostly Pixel devices), but now I am seeing it from a lot of different devices, e.g.
Redmi Note 4,Gemini 4G, andMoto G(4) Plus.From
#hackers-flutterfire..:Occurs in versions
cloud_firestore: 0.12.9,Flutter SDK: v1.9.8and probably versions from the months before that.