mxn21 / FlowingDrawer

swipe display drawer with flowing & bouncing effects.
Apache License 2.0
2.57k stars 468 forks source link

java.lang.IndexOutOfBoundsException: Inconsistency detected. #46

Closed nikolalukovic closed 7 years ago

nikolalukovic commented 7 years ago

This is the first time this lib crashed after using it for about a year, and it crashed in production 😖.
And i have no idea how to reproduce it since a user reported it to developer console. It's Android 7.0 and the device is Galaxy S7 Edge. Here's the stacktrace:

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{43272cb position=2 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached not recyclable(1) no parent}
    at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(Unknown Source)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
    at android.support.v7.widget.LinearLayoutManager$LayoutState.next(Unknown Source)
    at android.support.v7.widget.LinearLayoutManager.layoutChunk(Unknown Source)
    at android.support.v7.widget.LinearLayoutManager.fill(Unknown Source)
    at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(Unknown Source)
    at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(Unknown Source)
    at android.support.v7.widget.RecyclerView.dispatchLayout(Unknown Source)
    at android.support.v7.widget.RecyclerView.onLayout(Unknown Source)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at com.mxn.soul.flowingdrawer_core.FlowingDrawer.onLayout(Unknown Source)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.support.design.widget.CoordinatorLayout.layoutChild(Unknown Source)
    at android.support.design.widget.CoordinatorLayout.onLayoutChild(Unknown Source)
    at android.support.design.widget.CoordinatorLayout.onLayout(Unknown Source)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at com.android.internal.policy.DecorView.onLayout(DecorView.java:818)
    at android.view.View.layout(View.java:18793)
    at android.view.ViewGroup.layout(ViewGroup.java:5952)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2615)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2331)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1490)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7027)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
    at android.view.Choreographer.doCallbacks(Choreographer.java:702)
    at android.view.Choreographer.doFrame(Choreographer.java:638)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6688)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
mxn21 commented 7 years ago

Hi,sorry about that , but it seems to be a problem of RecyclerView the following url will help you : http://stackoverflow.com/questions/31759171/recyclerview-and-java-lang-indexoutofboundsexception-inconsistency-detected-in

nikolalukovic commented 7 years ago

Yup, saw later as well that it's something with RecyclerView. Sorry, and thanks. I'll close the issue...