Crashes and ANR on Android Developer Console

22,400

Solution 1

ANR stands for Application Not Responding. If your app is doing a lot of work on the UI thread then you'll see one of those force close/wait dialogs. That's ANR.

As for crash reporting, if your app is distributed through Google Play then crash reporting is built in. When your app crashes, the user will get a dialog with the options "Force Close" or "Report." The user has to press the Report option to send you the crash report, otherwise you may never know.

If you're not distributing through Google Play, you might want to consider a library like ACRA which will email you crash reports, upload them to a Google Docs spreadsheet, or you can write your own custom handler for dealing with crash reports.

Details about ACRA can be found here: http://code.google.com/p/acra/

Below is a sampling of what these dialogs look like. Close/report dialogs on the left and ANR on the right. Android 3.0+ is on top with the older dialogs on the bottom.

enter image description here

Solution 2

When an application crashes, a tombstone is generated. Essentially, your app needs to be aware that portions of it crashed (if you rely on some API or library that provides callbacks / status) but if it's really just your app dying - you will have a somewhat hard time figuring out whether it crashed or not.

"Error reporting" isn't a premade class you can use in android, and you may have to roll one of your own. Then again, there's ACRA - http://acra.ch/

some links:

http://android-developers.blogspot.com/2010/05/google-feedback-for-android.html

http://developer.android.com/distribute/googleplay/strategies/app-quality.html

Share:
22,400
lyk
Author by

lyk

Updated on December 28, 2020

Comments

  • lyk
    lyk over 3 years

    I just recently launched an application on the Google Play Store, and I was exploring the developer console and saw the tab for Crashes and ANR.

    What does ANR stand for?

    Also, my app seems to have crashed on some of my friend's phone before, but there was no way for them to "report" such crashes. How should I enable such functions for users to report crashes for me to see in the developer console under the Crashes/ANR tab?

  • lyk
    lyk over 11 years
    Hmm that's weird because it seems to appear on my friend's phone that it just says "<AppName> has stopped" and he can only click on Ok.
  • Michael Celey
    Michael Celey over 11 years
    I haven't had an app crash in awhile so I can't say for sure what it looks like now but the feature was introduced in Android 2.2 and used to look like this: android-developers.blogspot.com/2010/05/…
  • lyk
    lyk over 11 years
    Yup I've seen that on other apps before too! That's why I was wondering if something special needs to be done to activate this since my app doesn't seem to have it upon crashing...
  • Akh
    Akh about 11 years
    ACRA cant' catch and report ANR. Because Acra runs with the app's VM and the ANRs are generated outside the VM by the system watchdog. But ACRA is very handy to report Java Exceptions. ANR and JNI exception reporting features are not available currently. groups.google.com/forum/#!msg/acra-discuss/ETy1bm7pvh8/…
  • Konrad Morawski
    Konrad Morawski about 10 years
    One question. If I make the app restart upon the crash - like in this answer stackoverflow.com/a/2903866/168719 - is it still going to report the crash details to Google? (I'd like it to)
  • Michael Celey
    Michael Celey about 10 years
    @KonradMorawski It shouldn't report to Google in that case because you're catching the uncaught exception and using it to restart the app.
  • Konrad Morawski
    Konrad Morawski about 10 years
    @MCeley thanks. is it possible to make it still report the exception (and then restart the app anyway)?
  • Michael Celey
    Michael Celey about 10 years
    The only way the exception will report is if you don't catch it. If you don't catch it, the app crashes. So your two options are to either catch it and restart the app without it reporting or to let it crash your app and the user can then report it. However, you have a third solution if you're using something like ACRA or Google Analytics. With ACRA or GA, you can report the exception to your own exception handler. The exception won't report to Google Play but you can still get the details of the exception from the other tools.