-6

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException length=12; index=12 I encounter this bug only on samsung 6.0.1(android version) device.I didn't encounter this bug on any other android devices

stacktrace is below There is crash report on crashlytics but I couldn't reproduce error.

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=12; index=12 at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1833) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.widget.ScrollView.dispatchHoverEvent(ScrollView.java:1107) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:2176) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1878) at android.view.View.dispatchGenericMotionEvent(View.java:10074) at com.android.internal.policy.PhoneWindow$DecorView.superDispatchGenericMotionEvent(PhoneWindow.java:2839) at com.android.internal.policy.PhoneWindow.superDispatchGenericMotionEvent(PhoneWindow.java:1873) at android.app.Activity.dispatchGenericMotionEvent(Activity.java:3082) at android.support.v7.view.WindowCallbackWrapper.dispatchGenericMotionEvent(WindowCallbackWrapper.java:70) at com.android.internal.policy.PhoneWindow$DecorView.dispatchGenericMotionEvent(PhoneWindow.java:2806) at android.view.View.dispatchPointerEvent(View.java:10230) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5344) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5180) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4781) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4838) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7306) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7184) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7145) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7416) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:323) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

hugerde
  • 919
  • 1
  • 12
  • 27
  • 2
    Java array indexes are 0 based. Someone in your code isn't taking that into account. – TZHX Sep 28 '16 at 14:49
  • not enough info... make sure you add your question with enough information of what you were trying to do or code... – swapyonubuntu Sep 28 '16 at 14:49
  • @TZHX error didn't seem in my code , error occured android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1833) it isnt my code – hugerde Sep 29 '16 at 07:14
  • @swapyonubuntu this is all my information and error didnt seen in my code Full stacktrace is added – hugerde Sep 29 '16 at 07:16

1 Answers1

1

In the function android.view.ViewGroup.dispatchHoverEvent, there is an array. Let's call it foo.

foo.length is 12.

But someone has written, in line 1833, foo[n] for n being 12.

That's now allowed since, for an array of length 12. n must be between 0 and 11 inclusive. This, by the way, is an extremely common error to make.

I hope this is of some use. If anything it demonstrates how useful stack traces are.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483