java.lang.ArrayIndexOutOfBoundsException: length=32; index=32

Appcelerator JIRA | Adam Fennell | 1 year ago
  1. 0

    When executing the following code, if there are more than 29 rows, the app will crash when scrolling back up from the bottom of the TableView: (You may need to try more than 30 rows for the app to crash, as each device may vary this number) {code} var section = Ti.UI.createTableViewSection(); var numberOfRows = 30; //if > 29 the app will crash when scrolling back up from the bottom for (var i=0; i < numberOfRows; i++) { //fill section with rows section.add(Ti.UI.createTableViewRow({ height: 50, width: Ti.UI.FILL, backgroundColor: 'green', className: 'row' + i })); }; var table = Ti.UI.createTableView({ top: 0, left: 0, height: Ti.UI.FILL, width: Ti.UI.FILL, data: [ section ] }); var window = Ti.UI.createWindow({ fullscreen: true }); window.add(table); window.open(); {code} *The error log from the Studio console is:* {code} [ERROR] : InputEventReceiver: Exception dispatching input event. [DEBUG] : AndroidRuntime: Shutting down VM [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x410532a0) [ERROR] : TiApplication: (main) [25408,25408] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException: length=32; index=32; Titanium 3.5.1,2015/03/05 10:08,96875c9 [ERROR] : TiApplication: java.lang.ArrayIndexOutOfBoundsException: length=32; index=32 [ERROR] : TiApplication: at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:7127) [ERROR] : TiApplication: at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5694) [ERROR] : TiApplication: at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3424) [ERROR] : TiApplication: at android.widget.AbsListView.onTouchEvent(AbsListView.java:4099) [ERROR] : TiApplication: at android.view.View.dispatchTouchEvent(View.java:7350) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2464) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2151) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1480) [ERROR] : TiApplication: at android.app.Activity.dispatchTouchEvent(Activity.java:2469) [ERROR] : TiApplication: at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:268) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2099) [ERROR] : TiApplication: at android.view.View.dispatchPointerEvent(View.java:7535) [ERROR] : TiApplication: at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3492) [ERROR] : TiApplication: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3424) [ERROR] : TiApplication: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4534) [ERROR] : TiApplication: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4512) [ERROR] : TiApplication: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4616) [ERROR] : TiApplication: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) [ERROR] : TiApplication: at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) [ERROR] : TiApplication: at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163) [ERROR] : TiApplication: at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4584) [ERROR] : TiApplication: at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4635) [ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) [ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:555) [ERROR] : TiApplication: [ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) [ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:615) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:92) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4921) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} I have tried removing the "className" property from the TableViewRow, which stops the crashing, but prevents Buttons and other Views inside the TableViewRow redrawing correctly, so must be left in (as indicated by the Appcelerator Platform Docs). Due to our customers using JellyBean devices, we need the fix in 3.5.1 or 3.5.2, as the devices can't be upgraded to newer Android versions. *Possible Cause:* This may be caused by an issue with 0-Based indexes used in getItemViewType() or getViewTypeCount() in titanium_mobile/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java

    Appcelerator JIRA | 1 year ago | Adam Fennell
    java.lang.ArrayIndexOutOfBoundsException: length=32; index=32
  2. 0

    When executing the following code, if there are more than 29 rows, the app will crash when scrolling back up from the bottom of the TableView: (You may need to try more than 30 rows for the app to crash, as each device may vary this number) {code} var section = Ti.UI.createTableViewSection(); var numberOfRows = 30; //if > 29 the app will crash when scrolling back up from the bottom for (var i=0; i < numberOfRows; i++) { //fill section with rows section.add(Ti.UI.createTableViewRow({ height: 50, width: Ti.UI.FILL, backgroundColor: 'green', className: 'row' + i })); }; var table = Ti.UI.createTableView({ top: 0, left: 0, height: Ti.UI.FILL, width: Ti.UI.FILL, data: [ section ] }); var window = Ti.UI.createWindow({ fullscreen: true }); window.add(table); window.open(); {code} *The error log from the Studio console is:* {code} [ERROR] : InputEventReceiver: Exception dispatching input event. [DEBUG] : AndroidRuntime: Shutting down VM [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x410532a0) [ERROR] : TiApplication: (main) [25408,25408] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException: length=32; index=32; Titanium 3.5.1,2015/03/05 10:08,96875c9 [ERROR] : TiApplication: java.lang.ArrayIndexOutOfBoundsException: length=32; index=32 [ERROR] : TiApplication: at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:7127) [ERROR] : TiApplication: at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5694) [ERROR] : TiApplication: at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3424) [ERROR] : TiApplication: at android.widget.AbsListView.onTouchEvent(AbsListView.java:4099) [ERROR] : TiApplication: at android.view.View.dispatchTouchEvent(View.java:7350) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2464) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470) [ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2151) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1480) [ERROR] : TiApplication: at android.app.Activity.dispatchTouchEvent(Activity.java:2469) [ERROR] : TiApplication: at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:268) [ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2099) [ERROR] : TiApplication: at android.view.View.dispatchPointerEvent(View.java:7535) [ERROR] : TiApplication: at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3492) [ERROR] : TiApplication: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3424) [ERROR] : TiApplication: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4534) [ERROR] : TiApplication: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4512) [ERROR] : TiApplication: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4616) [ERROR] : TiApplication: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) [ERROR] : TiApplication: at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) [ERROR] : TiApplication: at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163) [ERROR] : TiApplication: at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4584) [ERROR] : TiApplication: at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4635) [ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) [ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:555) [ERROR] : TiApplication: [ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) [ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:615) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:92) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4921) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} I have tried removing the "className" property from the TableViewRow, which stops the crashing, but prevents Buttons and other Views inside the TableViewRow redrawing correctly, so must be left in (as indicated by the Appcelerator Platform Docs). Due to our customers using JellyBean devices, we need the fix in 3.5.1 or 3.5.2, as the devices can't be upgraded to newer Android versions. *Possible Cause:* This may be caused by an issue with 0-Based indexes used in getItemViewType() or getViewTypeCount() in titanium_mobile/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java

    Appcelerator JIRA | 1 year ago | Adam Fennell
    java.lang.ArrayIndexOutOfBoundsException: length=32; index=32
  3. 0

    Android AbsListView$RecycleBin.addScrapView(AbsListView.java:6588)

    Stack Overflow | 2 years ago | mr.boyfox
    java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Application crashes while scrolling my custom gridView

    Stack Overflow | 2 years ago | Nayra Ahmed
    java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6355)
  6. 0

    getting java.lang.ArrayIndexOutOfBoundsException in android

    Stack Overflow | 3 years ago | Pravin Patil
    java.lang.ArrayIndexOutOfBoundsException: length=2; index=2

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      length=32; index=32

      at android.widget.AbsListView$RecycleBin.addScrapView()
    2. Android Platform
      ViewGroup.dispatchTouchEvent
      1. android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:7127)
      2. android.widget.AbsListView.trackMotionScroll(AbsListView.java:5694)
      3. android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3424)
      4. android.widget.AbsListView.onTouchEvent(AbsListView.java:4099)
      5. android.view.View.dispatchTouchEvent(View.java:7350)
      6. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2464)
      7. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
      8. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      9. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      10. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      11. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      12. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      13. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      14. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      15. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      16. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      17. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      18. android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
      19. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
      19 frames
    3. Android
      PhoneWindow.superDispatchTouchEvent
      1. com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2151)
      2. com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1480)
      2 frames
    4. Android Platform
      Activity.dispatchTouchEvent
      1. android.app.Activity.dispatchTouchEvent(Activity.java:2469)
      1 frame
    5. Android v7
      ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent
      1. android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:268)
      1 frame
    6. Android
      PhoneWindow$DecorView.dispatchTouchEvent
      1. com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2099)
      1 frame
    7. Android Platform
      ActivityThread.main
      1. android.view.View.dispatchPointerEvent(View.java:7535)
      2. android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3492)
      3. android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3424)
      4. android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4534)
      5. android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4512)
      6. android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4616)
      7. android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
      8. android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
      9. android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
      10. android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4584)
      11. android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4635)
      12. android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
      13. android.view.Choreographer.doCallbacks(Choreographer.java:555)
      14. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
      15. android.os.Handler.handleCallback(Handler.java:615)
      16. android.os.Handler.dispatchMessage(Handler.java:92)
      17. android.os.Looper.loop(Looper.java:137)
      18. android.app.ActivityThread.main(ActivityThread.java:4921)
      18 frames
    8. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:511)
      2 frames
    9. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
      2 frames
    10. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame