java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{25b4ab3e position=3 id=-1, oldPos=2, pLpos:2 scrap [attachedScrap] tmpDetached no parent}

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via GitHub by bottiger

Try to use notifyDataSetChanged() instead of notifyItemRemoved(). There's a bug in RecyclerView and notifyItemRemoved() does not work in some environments.

Solutions on the web

via Stack Overflow by belvi
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{25b4ab3e position=3 id=-1, oldPos=2, pLpos:2 scrap [attachedScrap] tmpDetached no parent}
via GitHub by akihito104
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{1529151c position=24 id=-1, oldPos=5, pLpos:5 scrap [attachedScrap] tmpDetached no parent}
via GitHub by bornest
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{1630a510 position=44 id=-1, oldPos=45, pLpos:45 scrap [attachedScrap] tmpDetached no parent}
via Stack Overflow by Lê Khánh Vinh
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{99076db position=1 id=-1, oldPos=0, pLpos:0 scrap [attachedScrap] tmpDetached no parent} 'WadeF'
via GitHub by pepitoria
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{42bb4ac0 position=14 id=-1, oldPos=6, pLpos:6 scrap [attachedScrap] tmpDetached no parent}
via GitHub by chip2n
, 10 months ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{2fe4242 position=30 id=-1, oldPos=5, pLpos:5 scrap [attachedScrap] tmpDetached no parent}
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{25b4ab3e position=3 id=-1, oldPos=2, pLpos:2 scrap [attachedScrap] tmpDetached no parent}
at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:4499)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4630)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4611)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1988)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1384)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1347)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2977)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2901)
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1457)
at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5319)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
11 times, 1 year ago
28 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.