java.lang.IndexOutOfBoundsException

tip

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

tip

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

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Crash
    via GitHub by SlideAutoreport
    ,
  • note 2 kitkat
    via GitHub by SlideAutoreport
    ,
  • GitHub comment 262#270123552
    via GitHub by SolidScorpion
    ,
    • 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.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3277) 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.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1183) 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

    filpgamefilpgame
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Stefan BrauneStefan Braune
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    27 more bugmates