airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.47k stars 731 forks source link

[PagedListController] Getting IndexOutOfBoundsException when scrolling to fast #699

Open MTRNord opened 5 years ago

MTRNord commented 5 years ago
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: blog.nordgedanken.simplematrix.fcm, PID: 31504
    java.lang.IndexOutOfBoundsException: Index out of bounds - passed position = 30, old list size = 30
        at androidx.recyclerview.widget.DiffUtil$DiffResult.convertOldPositionToNew(DiffUtil.java:672)
        at androidx.paging.PagedStorageDiffHelper.transformAnchorIndex(PagedStorageDiffHelper.java:215)
        at androidx.paging.AsyncPagedListDiffer.latchPagedList(AsyncPagedListDiffer.java:382)
        at androidx.paging.AsyncPagedListDiffer$2$1.run(AsyncPagedListDiffer.java:345)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Hi I do get this error with paged lists when scrolling to fast. It didn't happen with Version 3.0.0 But does atleast since 3.2.0.

MTRNord commented 5 years ago

Disabling animations seems to resolve this animation kind of. Not sure why or if thats pure luck while scrolling Disabled animations do not change it

Nailik commented 5 years ago

Disableing placeholders fixed it for me but brings much other problems, like my views (horizontal viewpager oder vertical recyclerview) is moving randomly scrolling data is updated or inserted.

asalha commented 4 years ago

I have the same problem and the same error in another project. It seems a bug in Android I suppose as it happens randomly. In my case, it happens when I delete randomly items in the RecyclerView when placeholders set to true and hasStableIds set to true also. Never happened when placeholders set to false and hasStableIds set to false. Any idea how to solve this issue? Thanks

abdulelahragih commented 4 years ago

I have the same problem, it happens randomly and in some devices, my app in play store report this problem to Crashlytics 2 times. I hope it will be fixed.

RobbWatershed commented 4 years ago

Look like it's a bug from Android

See https://stackoverflow.com/questions/55546116/room-livedata-with-paging-getting-indexoutofboundsexception-in-some-devices and https://issuetracker.google.com/issues/135628748