Stands for "Application Not Responding." ANR is an abbreviation that describes an unresponsive Android app. When an app is running on an Android device and stops responding, an "ANR" event is triggered. Two conditions may cause an ANR error on an Android device:
- An active app does not respond to an input event within 5 seconds.
- The BroadcastReceiver class does not finish executing after a long period of time.
If an ANR error happens on your Android device, a dialog box will appear on the screen. The message will inform you the application is not responding and will ask if you want to close the app. You have two options: or . Choosing "Wait" will allow you to keep waiting if you want to give the app more time. Choosing "OK" will close the app and you may lose unsaved activity.
ANR errors happen for many different reasons. Some are developer-related, such as a poorly written function that loops more times than necessary. Others are device-related, meaning the hardware cannot keep up with the demands of the app. For example, if an app is rendering a large document, it may take several seconds to load the data and render the image on the screen. This could produce an ANR message, though the process might complete a few seconds later.
Because ANRs create a poor user experience, developers aim to avoid them or at least reduce the number of occurrences as much as possible. The Android operating system records ANRs and the corresponding activities to help developers debug their apps. If an app is distributed via Google Play, the ANR data is automatically sent to Google. Developers can review the ANR data in the Android Vitals section of the Developer Console.
NOTE: No personal data is transmitted with ANR data. Only the app version, Android version, device type, and activity data (such as the current process) are recorded.