Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12487] Android: IndexOutOfBoundsException when backing out of an app after install from app store

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-02-20T08:16:03.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.2, Release 3.1.0, 2013 Sprint 03 Core, 2013 Sprint 03
ComponentsAndroid
Labelscore, module_memory, qe-testadded
ReporterAllen Yeung
AssigneeAllen Yeung
Created2013-01-30T01:47:29.000+0000
Updated2013-02-20T08:16:03.000+0000

Description

Reproduction steps: 1. Create a new titanium app 2. Put the following entry inside your tiapp.xml
<property name="ti.android.bug2373.disableDetection" type="bool">true</property>
3. Create an apk for the app via the distribute command 4. Push the app to the phone via 'adb push myApp /mnt/sdcard/' 5. Use some file explorer on your phone like Astro (you may need to download this) and install the app 6. After the app has been installed, click 'open' 7. Push home 8. Open the same app again from the app list 9. Repeat 7-8 a few times 10. When you have the app open, hit back Expected Result: The app should back out without crashing Actual Result: The app crashes with the error message:
E/AndroidRuntime(19143): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
E/AndroidRuntime(19143): 	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
E/AndroidRuntime(19143): 	at java.util.ArrayList.get(ArrayList.java:304)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiApplication.terminateActivityStack(TiApplication.java:201)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiRootActivity.finish(TiRootActivity.java:164)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiApplication.terminateActivityStack(TiApplication.java:205)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiRootActivity.finish(TiRootActivity.java:164)
E/AndroidRuntime(19143): 	at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java:167)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiBaseActivity.onBackPressed(TiBaseActivity.java:609)
E/AndroidRuntime(19143): 	at android.app.Activity.onKeyUp(Activity.java:2099)
E/AndroidRuntime(19143): 	at android.view.KeyEvent.dispatch(KeyEvent.java:2575)
E/AndroidRuntime(19143): 	at android.app.Activity.dispatchKeyEvent(Activity.java:2329)
E/AndroidRuntime(19143): 	at org.appcelerator.titanium.TiBaseActivity.dispatchKeyEvent(TiBaseActivity.java:740)
E/AndroidRuntime(19143): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1806)
E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3327)
E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3300)
E/AndroidRuntime(19143): 	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2460)
E/AndroidRuntime(19143): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(19143): 	at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(19143): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(19143): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(19143): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(19143): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(19143): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(19143): 	at dalvik.system.NativeStart.main(Native Method)
NOTE: This seems to happen consistently on 4.0.4 devices. This behavior varies on other versions.

Comments

  1. Allen Yeung 2013-01-30

    https://github.com/appcelerator/titanium_mobile/pull/3827
  2. Shyam Bhadauria 2013-02-04

    App is not crashing now on repeatedly opening it from home page. Environment used for verification - Titanium SDK: 3.0.2.v20130201161712 Titanium  Studio:3.0.2.201301251115 Device: Samsung GALAXY Note (2.3.6)
  3. Shyam Bhadauria 2013-02-20

    Re-opening to edit label

JSON Source