java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{fe4b454 position=4 id=-1, oldPos=1, pLpos:1 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 GitHub by andansky
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{fe4b454 position=4 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached no parent}
via GitHub by stonecold123
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{21e958a8 position=18 id=-1, oldPos=18, pLpos:-1 scrap [attachedScrap] tmpDetached no parent}
via GitHub by yilzer
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{9a846b6 position=30 id=-1, oldPos=0, pLpos:0 scrap [attachedScrap] tmpDetached no parent}
via GitHub by dalb8
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{64a18148 position=3 id=3, oldPos=2, pLpos:2 scrap tmpDetached no parent}
via GitHub by Alexendoo
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{305bcc44 position=0 id=-1, oldPos=0, pLpos:-1 scrap [attachedScrap] tmpDetached no parent}
via Stack Overflow by Владимир Фишер
, 1 year ago
Inconsistency detected. Invalid view holder adapter positionViewHolder{42319ed8 position=1 id=-1, oldPos=0, pLpos:0 scrap tmpDetached no parent}
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{fe4b454 position=4 id=-1, oldPos=1, pLpos:1 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.GridLayoutManager.layoutChunk(GridLayoutManager.java:528)
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.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2977)
at android.view.View.measure(View.java:18026)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:760)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18026)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1292)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:471)
at android.widget.ScrollView.onMeasure(ScrollView.java:348)
at android.view.View.measure(View.java:18026)
at com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout.onMeasure(SwipyRefreshLayout.java:576)
at android.view.View.measure(View.java:18026)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:760)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18026)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:471)
at android.view.View.measure(View.java:18026)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:760)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:18026)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:471)
at android.view.View.measure(View.java:18026)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2480)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1457)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1692)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1335)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6755)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:572)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:5855)

Users with the same issue

Once, 1 year ago
2 times, 1 year ago
Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago

Write tip

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