Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Force Close Uncatchable Unreportable

I've released my second game project on the Android Market this week, and immediately had multiple 1-star reports due to force closes. I tested it on many handsets and many emulators with zero issues. I'm completely at a loss for how to proceed and looking for advice.

I use Thread.setDefaultUncaughtExceptionHandler to intercept and report uncaught exceptions, then close gracefully. The people reporting force closes aren't getting to any of that, even though it is the first thing set in the application's main task constructor, and everything is wrapped in try/catches throughout. They are also reporting that there is no "Send Report" option in the force close popup (providing the Developer Console error reports), so I have absolutely no way of knowing what the problem is.

Uses Android 2.0, with android:minSdkVersion="5". Only Permission required is INTERNET.

(on Android market as 'Fortunes of War FREE' if you want to test)

like image 359
Whalesong Games Avatar asked Mar 08 '26 10:03

Whalesong Games


2 Answers

I'm a bit surprised about the missing "Send report" button. What API level did you build the game with? I usually build the level with your minimum API level to make sure you're not using any API calls beyond that, but then switch back to the highest API level so you can use functionality like "install to SD".

I'm sure there's at least one user who wrote you a mail. Can you ask them to install LogCollector and mail you the log?

Btw, in general, I wouldn't use Thread.setDefaultUncaughtExceptionHandler so there IS the option to send a report. (It's ominously missing in your case, but normally, it should be there.)

Btw btw, the exception handler applies to the current thread. If you have an OpenGL app, maybe the crash happens in the GL thread?

like image 129
EboMike Avatar answered Mar 11 '26 04:03

EboMike


I'm not sure if I understood you correctly, but as far as I know Android only shows that report dialog if you use its default UncaughtExceptionHandler.

Try this:
In your UncaughtExceptionHander's constructor, call Thread.getDefaultUncaughtExceptionHandler and save the returned object in a variable (let's call it defaultHandler). In your Handler's uncaughtException() do the things you want to do, and then call defaultHandler.uncaughtException() afterwards.

Maybe something you should know:
In my experience, your Context isn't functional anymore at uncaughtException(). So, you can't send broadcasts, etc anymore.

By the way, if you really wrapped everything in try/catch, that could be the reason why error reporting doesn't work as expected? :P

Good luck
Tom

like image 32
TomTasche Avatar answered Mar 11 '26 02:03

TomTasche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!