QuisApp / flutter_contacts

MIT License
84 stars 140 forks source link

App Crash: Couldn't read row 1012, col 0 from CursorWindow #86

Closed marcodecarolisidt closed 1 year ago

marcodecarolisidt commented 1 year ago

Hi we have this Crash on our Firebase crashlytics, that we cannot reproduce, but it is happening for many users:

flutter_contacts: 1.1.5

Fatal Exception: java.lang.IllegalStateException: Couldn't read row 1012, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetString(CursorWindow.java)
       at android.database.CursorWindow.getString(CursorWindow.java:469)
       at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:53)
       at android.database.CursorWrapper.getString(CursorWrapper.java:141)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select$getString(FlutterContacts.kt:190)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select(FlutterContacts.kt:196)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select$default(FlutterContacts.java:55)
       at co.quis.flutter_contacts.FlutterContactsPlugin$onMethodCall$2.invokeSuspend(FlutterContactsPlugin.kt:213)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
joachim-quis commented 1 year ago

Thanks for reporting. Unfortunately without more details it's hard to debug. Let me know if you have more details or are able to diagnose it further.

wujek-srujek commented 4 months ago

We are getting this issue as well in production, although it is very, very rare.

Fatal Exception: java.lang.IllegalStateException: Couldn't read row 896, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetString(CursorWindow.java)
       at android.database.CursorWindow.getString(CursorWindow.java:469)
       at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:53)
       at android.database.CursorWrapper.getString(CursorWrapper.java:152)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select$getString(FlutterContacts.kt:190)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select(FlutterContacts.kt:196)
       at co.quis.flutter_contacts.FlutterContacts$Companion.select$default(FlutterContacts.kt:55)
       at co.quis.flutter_contacts.FlutterContactsPlugin$onMethodCall$2.invokeSuspend(FlutterContactsPlugin.kt:208)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

This issue was on Flutter 3.19.5 and flutter_contacts 1.1.7+1. Our code using flutter_contacts is trivial:

final contacts = await FlutterContacts.getContacts(
      withThumbnail: true,
      withProperties: true,
    );
devflu commented 2 months ago

This is not fixed. It is still occurring in Production.

Exception java.lang.IllegalStateException: Couldn't read row 843, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. at android.database.CursorWindow.nativeGetString at android.database.CursorWindow.getString (CursorWindow.java:469) at android.database.AbstractWindowedCursor.getString (AbstractWindowedCursor.java:53) at android.database.CursorWrapper.getString (CursorWrapper.java:141) at co.quis.flutter_contacts.FlutterContacts$Companion.select$getString (FlutterContacts.kt:190) at co.quis.flutter_contacts.FlutterContacts$Companion.select (FlutterContacts.kt:196) at co.quis.flutter_contacts.FlutterContacts$Companion.select$default$32da9ec2 (FlutterContacts.kt:55) at co.quis.flutter_contacts.FlutterContactsPlugin$onMethodCall$2.invokeSuspend (FlutterContactsPlugin.kt:213) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:108) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run (LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run (Tasks.kt:103) at kotlinx.coroutines.scheduling.CoroutineScheduler.currentWorker (CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:11793)