0

Recently I uploaded an app and have received many IllegalStateException and RuntimeException errors. They seem to occur whenever an activity ends/begins but I cant find any explanation. In one of my activities i have a 30 second timer and one user reported a crash when the timer reached 11 seconds which is odd because there is no background activities and nothing different happens at 11 than the previous seconds. The problem is I have never experienced any crashes with the app first hand on the emulators or the devices i have vigorously tested it on. Im wondering what could be the possible causes? Another user said it worked fine the first 2 times they played it but then it crashed. Im wondering could it be something to do with memory as I have very few crash reports off higher end models (little from nexus 7, none from S3) and the majority crashes are from devices classified as OTHERS (presumably less popular cheaper devices..)

I have asked about this before (with code/crash reports): Android mysterious null pointer exception

Any tips would be appreciated. I know from feedback it works fine on some Nexus 7 devices but crashes on others. It seems to be unplayable on HTC wildfire. The crashes are occuring in normal situations like when the user presses a button to advance to the next screen. I can upload any more code or crash reports if ye think they will benefit!

Many thanks!

Community
  • 1
  • 1
Bryan
  • 23
  • 6
  • 1
    So why don't you put your some Log in the code and show where it crashes? What is in your logcat? – B770 Apr 27 '13 at 17:17
  • @B770 I removed the log code in the published version. I have fixed all the errors that i was getting in logcat with my own device in eclipse but that didn't make any difference to the other users. – Bryan Apr 27 '13 at 17:41
  • IndexOutOfBoundsException: Invalid index 0, size is 0. looks like there is a problem with the ArrayList. Perhaps you look at this part in the code and log it – B770 Apr 27 '13 at 17:54

1 Answers1

0

I played it twice on an HTC Wildfire 2 and got these exceptions:

E/AndroidRuntime( 2165): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bryan.barrett.countdownforandroid/com.bryan.barrett.countdownforandroid.lettersPoints}: java.lang.IndexO
utOfBoundsException: Invalid index 0, size is 0
E/AndroidRuntime( 2165):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1852)
E/AndroidRuntime( 2165):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1873)
E/AndroidRuntime( 2165):        at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime( 2165):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
E/AndroidRuntime( 2165):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2165):        at android.os.Looper.loop(Looper.java:150)
E/AndroidRuntime( 2165):        at android.app.ActivityThread.main(ActivityThread.java:4358)
E/AndroidRuntime( 2165):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2165):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 2165):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
E/AndroidRuntime( 2165):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
E/AndroidRuntime( 2165):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2165): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
E/AndroidRuntime( 2165):        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
E/AndroidRuntime( 2165):        at java.util.ArrayList.get(ArrayList.java:311)
E/AndroidRuntime( 2165):        at com.bryan.barrett.countdownforandroid.lettersPoints.onCreate(Unknown Source)

and

E/Database( 2165): close() was never explicitly called on database '/data/data/com.bryan.barrett.countdownforandroid/databases/progress.db'
E/Database( 2165): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/Database( 2165):      at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1954)
E/Database( 2165):      at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:902)
E/Database( 2165):      at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:936)
E/Database( 2165):      at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:929)
E/Database( 2165):      at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:612)
E/Database( 2165):      at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
E/Database( 2165):      at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)
E/Database( 2165):      at com.bryan.barrett.countdownforandroid.a.d.<init>(Unknown Source)
E/Database( 2165):      at com.bryan.barrett.countdownforandroid.a.f.<init>(Unknown Source)
E/Database( 2165):      at com.bryan.barrett.countdownforandroid.lettersPoints.onCreate(Unknown Source)

Together with the exceptions you posted in your other question I'd recommend to take a step back and test this more seriously on the devices that cause the problems. Very likely it has to do with the Android version. My quick peek at the app on a Nexus 7 and a Nexus One didn't cause any crashes.

Emanuel Moecklin
  • 28,488
  • 11
  • 69
  • 85
  • Thanks for the feedback I have uploaded an update only compatible with versions 2.3.3 and higher (my version is 2.3.5 and a majority of downloads where in the 2.3.3 - 2.3.7 range) and i will let report back tomorrow.. Most of the crash reports resemble the first one you have posted.. an indexOutOfBoundException in the arraylist which doesnt occur on my own device or the emulators. @Emanuel Moecklin – Bryan Apr 27 '13 at 18:11