Status Update
Comments
ni...@gmail.com <ni...@gmail.com> #2
cl...@google.com <cl...@google.com> #3
Would you be able to provide a sample repro where I have access to the source code?
he...@gmail.com <he...@gmail.com> #5
nb...@indeed.com <nb...@indeed.com> #6
al...@gmail.com <al...@gmail.com> #8
I reproduced this crash by invalidating the data source while scrolling the list — it crashes soon after calling PagedListAdapter.submitData
.
Other than this one, 3.3.0 also caused a very similar raw IndexOutOfBoundsException Index: 61, Size: 25
, without the "inconsistency detected" message. I assume they are related.
ba...@gmail.com <ba...@gmail.com> #9
ba...@gmail.com <ba...@gmail.com> #10
cl...@google.com <cl...@google.com> #11
Is RemoteMediator used in the apps? I'll try to write my own sample app to repro this and need more info.
ni...@gmail.com <ni...@gmail.com> #12
Hi, I have posted POC that reproduces the crash without RemoteMediator to to
ni...@gmail.com <ni...@gmail.com> #13
Attaching here too
ma...@zentity.com <ma...@zentity.com> #14
We use paging 3 for data source. Our app crash on the same after updating from 3.2.1 to 3.3.0.
Also we see another crash in crashlytics, probably caused by same issue:
Fatal Exception: java.lang.IllegalStateException: Detected inconsistent adapter updates. The local position of the view holder maps to 2 which is out of bounds for the adapter with size 2.Make sure to immediately call notify methods in your adapter when you change the backing dataviewHolder:l{1b0f866 position=3 id=-1, oldPos=-1, pLpos:-1}adapter:Cd.m@e72f7ad
at androidx.recyclerview.widget.ConcatAdapterController.getLocalAdapterPosition(ConcatAdapterController.java:481)
at androidx.recyclerview.widget.ConcatAdapter.findRelativeAdapterPositionIn(ConcatAdapter.java:303)
at androidx.recyclerview.widget.RecyclerView$ViewHolder.getBindingAdapterPosition(RecyclerView.java:12043)
at redacted.decorator.ViewTypeDividerItemDecorator.drawDividerAfter(ViewTypeDividerItemDecorator.kt:31)
at redacted.decorator.DividerItemDecoration.drawVertical(DividerItemDecoration.kt:146)
at redacted.decorator.DividerItemDecoration.onDraw(DividerItemDecoration.kt:116)
at androidx.recyclerview.widget.RecyclerView.onDraw(RecyclerView.java:5009)
at android.view.View.draw(View.java:24406)
at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4944)
at android.view.View.updateDisplayListIfDirty(View.java:23267)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.View.draw(View.java:24136)
at android.view.ViewGroup.drawChild(ViewGroup.java:4748)
at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.kt:232)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4505)
at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.kt:222)
at android.view.View.updateDisplayListIfDirty(View.java:23253)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:777)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:783)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:881)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:5647)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5330)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4486)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3116)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:852)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
cl...@google.com <cl...@google.com> #15
re
cl...@google.com <cl...@google.com> #16
Thanks
Bug happens due to PagingDataPresenter
updating its internal PageStore to the new refreshed list prior to RV calculating diff.
When RV callback is triggered after calculating diff, it calls PagingDataAdapter.itemCount
and expects to get the previous list size (prior to refresh). However, PagingDataAdapter.itemCount
essentially delegates to PagingDataPresenter.size
which has already been updated to the new PageStore size at this point, and so the holder pos > adapter.itemCount()
condition is triggered, leading to the exception.
ni...@gmail.com <ni...@gmail.com> #17
Thanks very much. I suppose there is no quick workaround, what sort of timeline we would expect for the bug fix release?
cl...@google.com <cl...@google.com> #18
da...@gmail.com <da...@gmail.com> #19
h9...@drdiary.co.kr <h9...@drdiary.co.kr> #20
Is it normal for this error to occur even after updating the library to version 3.3.1? I’m asking because this error never occurred with version 3.2.1.
java.lang.IllegalStateException: Detected inconsistent adapter updates. The local position of the view holder maps to 9 which is out of bounds for the adapter with size 9.Make sure to immediately call notify methods in your adapter when you change the backing dataviewHolder
cl...@google.com <cl...@google.com> #21
re
Description
I have tried to upgrade tom 3.2.1 to 3.3.0 and published my app , however I've gotten quite some crashes:
Reverting the paging upgrade from 3.3.0 to 3.2.1 fixed all the problems for me and I no longer get this exception. This didn't happen for a lot of users but still it's something noticable.
I haven't changed anything regarding my implementation. What do you need from me?