java.lang.IndexOutOfBoundsException

tip

Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range. Applications can subclass this class to indicate similar exceptions.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • h5. This is a regression. It works as expected with 3.2.2.GA h5.Description: 1. Create an classic app & use the code below in the app.js. {code} var win = Ti.UI.createWindow({ backgroundColor: 'white', title: "ScrollableView Test" }); var sav = Ti.UI.createScrollableView(); win.add(sav); win.open(); {code} 3. Build that app for device/emulator. h5.Actual Result: 1. The app crashes & we get the following logs in console: {code} [ERROR] : TiApplication: (main) [335,335] Sending event: exception on thread: main msg:java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 [ERROR] : TiApplication: at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) [ERROR] : TiApplication: at java.util.ArrayList.get(ArrayList.java:304) [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUIScrollableView$2.onPageScrolled(TiUIScrollableView.java:192) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.onPageScrolled(ViewPager.java:1712) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.pageScrolled(ViewPager.java:1633) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:581) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1600) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.FrameLayout.onLayout(FrameLayout.java:448) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669) [ERROR] : TiApplication: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527) [ERROR] : TiApplication: at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.FrameLayout.onLayout(FrameLayout.java:448) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2147) [ERROR] : TiApplication: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1966) [ERROR] : TiApplication: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1179) [ERROR] : TiApplication: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4859) [ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) [ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:562) [ERROR] : TiApplication: at android.view.Choreographer.doFrame(Choreographer.java:532) [ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) [ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:725) [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:5328) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} h5. Expected Results: 1. The app should not crash when an empty scrollable view is added.
    via by Lokesh Choudhary,
  • h5. This is a regression. It works as expected with 3.2.2.GA h5.Description: 1. Create an classic app & use the code below in the app.js. {code} var win = Ti.UI.createWindow({ backgroundColor: 'white', title: "ScrollableView Test" }); var sav = Ti.UI.createScrollableView(); win.add(sav); win.open(); {code} 3. Build that app for device/emulator. h5.Actual Result: 1. The app crashes & we get the following logs in console: {code} [ERROR] : TiApplication: (main) [335,335] Sending event: exception on thread: main msg:java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 [ERROR] : TiApplication: at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) [ERROR] : TiApplication: at java.util.ArrayList.get(ArrayList.java:304) [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUIScrollableView$2.onPageScrolled(TiUIScrollableView.java:192) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.onPageScrolled(ViewPager.java:1712) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.pageScrolled(ViewPager.java:1633) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:581) [ERROR] : TiApplication: at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1600) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.FrameLayout.onLayout(FrameLayout.java:448) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669) [ERROR] : TiApplication: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527) [ERROR] : TiApplication: at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.widget.FrameLayout.onLayout(FrameLayout.java:448) [ERROR] : TiApplication: at android.view.View.layout(View.java:14482) [ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:4469) [ERROR] : TiApplication: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2147) [ERROR] : TiApplication: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1966) [ERROR] : TiApplication: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1179) [ERROR] : TiApplication: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4859) [ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) [ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:562) [ERROR] : TiApplication: at android.view.Choreographer.doFrame(Choreographer.java:532) [ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) [ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:725) [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:5328) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} h5. Expected Results: 1. The app should not crash when an empty scrollable view is added.
    via by Lokesh Choudhary,
  • IndexOutOfBoundsException
    via GitHub by mattjohnpowell
    ,
  • High: Getting an odd crash
    via GitHub by Ckozoh
    ,
    • java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) at java.util.ArrayList.get(ArrayList.java:304) at ti.modules.titanium.ui.widget.TiUIScrollableView$2.onPageScrolled(TiUIScrollableView.java:192) at android.support.v4.view.ViewPager.onPageScrolled(ViewPager.java:1712) at android.support.v4.view.ViewPager.pageScrolled(ViewPager.java:1633) at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:581) at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1600) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at android.widget.FrameLayout.onLayout(FrameLayout.java:448) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527) at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at android.widget.FrameLayout.onLayout(FrameLayout.java:448) at android.view.View.layout(View.java:14482) at android.view.ViewGroup.layout(ViewGroup.java:4469) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2147) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1966) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1179) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4859) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:532) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5328) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511)

    Users with the same issue

    Macapon
    6 times, last one,
    szoszi
    2 times, last one,
    Larten
    1 times, last one,
    Unknown visitor1 times, last one,
    winer222
    3 times, last one,
    237 more bugmates