ArrayIndexOutOfBoundsException для устройств Android 9 - PullRequest
0 голосов
/ 17 октября 2019

У меня было 6 случаев одного и того же сбоя (который я не могу воспроизвести) за период около месяца. Глядя на отчеты о сбоях, кажется, что все они происходят после того, как пользователь получил успешный запрос на вход в систему и перенаправлен к основному действию, в котором перечислены его «пакеты».

Вот полный logcat

Вот отчет о сбое:

    09-17 20:21:53.226 23121 23121 E AndroidRuntime: FATAL EXCEPTION: main
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: Process: uk.co.ontrac.ecoss, PID: 23121
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at java.util.Arrays.rangeCheck(Arrays.java:120)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at java.util.Arrays.fill(Arrays.java:2831)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.StaggeredGridLayoutManager$LazySpanLookup.invalidateAfter(StaggeredGridLayoutManager.java:2874)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.StaggeredGridLayoutManager.handleUpdate(StaggeredGridLayoutManager.java:1550)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.StaggeredGridLayoutManager.onItemsUpdated(StaggeredGridLayoutManager.java:1526)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView$6.dispatchUpdate(RecyclerView.java:1016)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView$6.onDispatchFirstPass(RecyclerView.java:1004)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.AdapterHelper.dispatchFirstPassAndUpdateViewHolders(AdapterHelper.java:315)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.AdapterHelper.dispatchAndUpdateViewHolders(AdapterHelper.java:301)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.AdapterHelper.applyUpdate(AdapterHelper.java:221)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.AdapterHelper.preProcess(AdapterHelper.java:105)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView.processAdapterUpdatesAndSetAnimationFlags(RecyclerView.java:3583)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3829)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3639)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:625)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1083)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at com.android.internal.policy.DecorView.onLayout(DecorView.java:1042)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.View.layout(View.java:22398)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:6577)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3363)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2827)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1873)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8478)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:761)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:696)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6986)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    09-17 20:21:53.226 23121 23121 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
...