java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0

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.

  • h1. Problem Using a 24-bit PNG as the backgroundImage of a view causes the app to crash on 1.7.2 on device. h2. Reproduction 1. Download the following image to your resources directory: http://tothsolutions.com/logostrip.png (note: if you specify the remote image, the app will NOT crash. But if you save it locally and use that image, it will crash.) 2. Drop the following in an app.js, and run it using 1.7.2. The app will crash. {code:title=app.js} var win = Ti.UI.createWindow(); win.add(Ti.UI.createView({ top: 0, left: 0, right: 0, height: 33, backgroundImage: 'logostrip.png' })); win.open(); {code} h2. Error Log {code:title=Error Log} 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): (main) [218,608] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0; Titanium 1.7.2,2011/07/21 09:36,97c3689 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2757) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2775) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.access$2500(ActivityThread.java:130) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Handler.dispatchMessage(Handler.java:99) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Looper.loop(Looper.java:143) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.main(ActivityThread.java:4773) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.lang.reflect.Method.invokeNative(Native Method) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.lang.reflect.Method.invoke(Method.java:521) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at dalvik.system.NativeStart.main(Native Method) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.util.ArrayList.get(ArrayList.java:311) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiNinePatchHelper.createChunk(TiNinePatchHelper.java:187) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiNinePatchHelper.process(TiNinePatchHelper.java:50) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:320) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:260) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiUIHelper.buildBackgroundDrawable(TiUIHelper.java:447) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:655) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:453) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:38) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:434) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:196) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:100) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:86) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Handler.dispatchMessage(Handler.java:95) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue.dispatchMessage(TiMessageQueue.java:320) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue.dispatchPendingMessages(TiMessageQueue.java:304) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue$2.getResult(TiMessageQueue.java:172) {code}
    via by Dawson Toth,
  • h1. Problem Using a 24-bit PNG as the backgroundImage of a view causes the app to crash on 1.7.2 on device. h2. Reproduction 1. Download the following image to your resources directory: http://tothsolutions.com/logostrip.png (note: if you specify the remote image, the app will NOT crash. But if you save it locally and use that image, it will crash.) 2. Drop the following in an app.js, and run it using 1.7.2. The app will crash. {code:title=app.js} var win = Ti.UI.createWindow(); win.add(Ti.UI.createView({ top: 0, left: 0, right: 0, height: 33, backgroundImage: 'logostrip.png' })); win.open(); {code} h2. Error Log {code:title=Error Log} 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): (main) [218,608] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0; Titanium 1.7.2,2011/07/21 09:36,97c3689 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2757) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2775) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.access$2500(ActivityThread.java:130) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Handler.dispatchMessage(Handler.java:99) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Looper.loop(Looper.java:143) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.app.ActivityThread.main(ActivityThread.java:4773) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.lang.reflect.Method.invokeNative(Native Method) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.lang.reflect.Method.invoke(Method.java:521) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at dalvik.system.NativeStart.main(Native Method) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at java.util.ArrayList.get(ArrayList.java:311) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiNinePatchHelper.createChunk(TiNinePatchHelper.java:187) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiNinePatchHelper.process(TiNinePatchHelper.java:50) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:320) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:260) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.util.TiUIHelper.buildBackgroundDrawable(TiUIHelper.java:447) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:655) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:453) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:38) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:434) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:196) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:100) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:86) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at android.os.Handler.dispatchMessage(Handler.java:95) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue.dispatchMessage(TiMessageQueue.java:320) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue.dispatchPendingMessages(TiMessageQueue.java:304) 08-04 11:33:29.649: ERROR/TiUncaughtHandler(11597): at org.appcelerator.titanium.TiMessageQueue$2.getResult(TiMessageQueue.java:172) {code}
    via by Dawson Toth,
  • StartApp Ad not showing on my App
    via Stack Overflow by nmvictor
    ,
  • How to solve Fatal Exception error?
    via Stack Overflow by user533787
    ,
    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.navtrak.navtrakmobile/com.navtrak.navtrakmobile.NavtrakActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2757) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2775) at android.app.ActivityThread.access$2500(ActivityThread.java:130) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4773) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) at java.util.ArrayList.get(ArrayList.java:311) at org.appcelerator.titanium.util.TiNinePatchHelper.createChunk(TiNinePatchHelper.java:187) at org.appcelerator.titanium.util.TiNinePatchHelper.process(TiNinePatchHelper.java:50) at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:320) at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:260) at org.appcelerator.titanium.util.TiUIHelper.buildBackgroundDrawable(TiUIHelper.java:447) at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:655) at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:453) at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:38) at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519) at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378) at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370) at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356) at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:434) at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:196) at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:100) at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:86) at android.os.Handler.dispatchMessage(Handler.java:95) at org.appcelerator.titanium.TiMessageQueue.dispatchMessage(TiMessageQueue.java:320) at org.appcelerator.titanium.TiMessageQueue.dispatchPendingMessages(TiMessageQueue.java:304) at org.appcelerator.titanium.TiMessageQueue$2.getResult(TiMessageQueue.java:172)

    Users with the same issue

    winer222
    winer2223 times, last one,
    Hiren Amaliyar
    Hiren Amaliyar12 times, last one,
    Indri Yunita
    Indri Yunita81 times, last one,
    justCodeit
    justCodeit1 times, last one,
    filpgame
    filpgame4 times, last one,
    236 more bugmates