donkingliang / ConsecutiveScroller

ConsecutiveScrollerLayout是Android下支持多个滑动布局(RecyclerView、WebView、ScrollView等)和普通控件(TextView、ImageView、LinearLayou、自定义View等)持续连贯滑动的容器,它使所有的子View像一个整体一样连续顺畅滑动。并且支持布局吸顶功能。
Apache License 2.0
2.72k stars 355 forks source link

偶现的一个问题 #205

Closed wallacedong closed 3 years ago

wallacedong commented 3 years ago

偶现的一个问题

06-18 15:26:26.498 21285 21285 E crash : java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.getAndVerifyPreorderedView(ViewGroup.java:3632) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2632) 06-18 15:26:26.498 21285 21285 E crash : at com.donkingliang.consecutivescroller.ConsecutiveScrollerLayout.dispatchTouchEvent(ConsecutiveScrollerLayout.java:655) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662) 06-18 15:26:26.498 21285 21285 E crash : at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:444) 06-18 15:26:26.498 21285 21285 E crash : at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1830) 06-18 15:26:26.498 21285 21285 E crash : at android.app.Activity.dispatchTouchEvent(Activity.java:3465) 06-18 15:26:26.498 21285 21285 E crash : at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69) 06-18 15:26:26.498 21285 21285 E crash : at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:402) 06-18 15:26:26.498 21285 21285 E crash : at android.view.View.dispatchPointerEvent(View.java:12768) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5259) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5059) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4574) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4627) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4593) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4733) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4601) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4790) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4574) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4627) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4593) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4601) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4574) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7304) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7271) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7232) 06-18 15:26:26.498 21285 21285 E crash : at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7412) 06-18 15:26:26.498 21285 21285 E crash : at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:254) 06-18 15:26:26.498 21285 21285 E crash : at android.os.MessageQueue.nativePollOnce(Native Method) 06-18 15:26:26.498 21285 21285 E crash : at android.os.MessageQueue.next(MessageQueue.java:332) 06-18 15:26:26.498 21285 21285 E crash : at android.os.Looper.loop(Looper.java:168) 06-18 15:26:26.498 21285 21285 E crash : at com.jd.paipai.ppershou.Global$loop$1.run(Global.kt:16) 06-18 15:26:26.498 21285 21285 E crash : at android.os.Handler.handleCallback(Handler.java:873) 06-18 15:26:26.498 21285 21285 E crash : at android.os.Handler.dispatchMessage(Handler.java:99) 06-18 15:26:26.498 21285 21285 E crash : at android.os.Looper.loop(Looper.java:207) 06-18 15:26:26.498 21285 21285 E crash : at android.app.ActivityThread.main(ActivityThread.java:6878) 06-18 15:26:26.498 21285 21285 E crash : at java.lang.reflect.Method.invoke(Native Method) 06-18 15:26:26.498 21285 21285 E crash : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 06-18 15:26:26.498 21285 21285 E crash : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

donkingliang commented 3 years ago

是什么情况下会出现这个报错,怎样操作能重现,出现的概率有多大?

wallacedong commented 3 years ago

是什么情况下会出现这个报错,怎样操作能重现,出现的概率有多大?

我又遇到一次,复现步骤我找不到

donkingliang commented 3 years ago

出现bug的场景时什么时候?是在进入页面是出现,还是滑动或者点击时,还是添加删除View时等

wallacedong commented 3 years ago

出现bug的场景时什么时候?是在进入页面是出现,还是滑动或者点击时,还是添加删除View时等

滑动的时候,里面有一些viewstub,可能会根据情况inflate

donkingliang commented 3 years ago

那可能是inflate时出现的错误,你把你的布局viewstub和动态inflate的代码发我一下,我排查一下。