java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 0(offset:-1).state:3

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 h6ah4i

You have to provide valid identical number for each child items.

,
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 Awais-Ali
, 1 year ago
Inconsistency detected. Invalid item position 0(offset:-1).state:3
via GitHub by rusmichal
, 11 months ago
Inconsistency detected. Invalid item position 1(offset:2).state:2
via GitHub by muhezi
, 1 year ago
Inconsistency detected. Invalid item position 11(offset:11).state:13
via Stack Overflow by Shoummo Rauth
, 11 months ago
Inconsistency detected. Invalid item position 0(offset:3).state:3
via GitHub by blFeedbackBot
, 2 years ago
Inconsistency detected. Invalid item position 3(offset:3).state:59
via GitHub by blFeedbackBot
, 1 year ago
Inconsistency detected. Invalid item position 6(offset:6).state:102
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 0(offset:-1).state:3
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4653)
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:584)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2977)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2901)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1742)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1651)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1877)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1653)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
at android.widget.HorizontalScrollView.onLayout(HorizontalScrollView.java:1474)
at com.woxthebox.draglistview.BoardView.onLayout(BoardView.java:115)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1037)
at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:747)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1156)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:760)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1742)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1651)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
at android.view.View.layout(View.java:15133)
at android.view.ViewGroup.layout(ViewGroup.java:4862)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)

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
Once, 8 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
34 times, 1 year ago
27 more bugmates

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