Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crashes and ANR on Android Developer Console

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?

like image 456
lyk Avatar asked Feb 06 '13 14:02

lyk


People also ask

What is the difference between ANR and crash in Android?

The difference between a crash and an ANR is that a crash is a code exception whereas an ANR is an ongoing state of nonresponsiveness. So when a crash happens, the app itself terminates. When an ANR happens, the user simply cannot do anything in the app and will eventually force quit it.

What causes ANR in Android?

Application Not Responding (ANR) errors are triggered when the UI thread of the application is not responding for more than 5 seconds. You can read more about ANRs and diagnosing ANRs in the Android documentation. Additionally, Crashlytics can help pinpoint specific problematic threads.

What is ANR in play console?

If your app stops responding, users get a dialog that allows them to wait or close the app. When these dialogs appear, they're known as "Application not responding" errors (or ANRs). ANR data is available in Play Console only.

How do you resolve ANR?

How to prevent an ANR? Stop doing heavy tasks on the main thread. Instead use worker threads such as IntentService, AsyncTask Handler, or another Thread simply.


1 Answers

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

like image 173
Michael Celey Avatar answered Oct 01 '22 11:10

Michael Celey