Мое приложение прекрасно работает с почти андроидными версиями. Но в Crashlytics и в некоторых устройствах я столкнулся с этим: «java.lang.ArithmeticException: деление на ноль». Его почти (если не всегда) в Android 4.x.Android: ArithmeticException в StaggeredGridLayoutManager
У меня есть StaggeredGridLayoutManager в RecyclerView (SuperRecyclerView).
Стек след:
Fatal Exception: java.lang.ArithmeticException: divide by zero
at android.support.v7.widget.StaggeredGridLayoutManager.updateMeasureSpecs(StaggeredGridLayoutManager.java:922)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:665)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:600)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3374)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3183)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3627)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:630)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1142)
at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:836)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:850)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1799)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14102)
at android.view.ViewGroup.layout(ViewGroup.java:4662)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2019)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1840)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1135)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4579)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4935)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(NativeStart.java)
Я не знаю, какая информация необходима подходить к этой проблеме, поэтому, пожалуйста, спросите меня, что вам нужно, так что я могу обновить этот вопрос.