ANR

An ANR (Application Not Responding) occurs when a task running on the main thread takes a long time to complete. During this time, the application interface stops updating and responding to user actions. As a result, a dialog box opens, offering the user to wait or close the app.

The report shows when ANRs occur most often. Use this information to prepare fixes.

For Android devices, you can configure the ANR monitoring mechanism:

  1. Enable ANR monitoring. It's disabled by default.

  2. Set the timeout to indicate how long a thread is to remain unresponsive for the ANR error to be logged. The default and minimum value is 5 seconds.

// Creating an extended library configuration.
AppMetricaConfig config = AppMetricaConfig.newConfigBuilder(API_KEY)
        // Enabling ANR monitoring. The default value is false.
        .withAnrMonitoring(true)
        // Override the ANR timeout if needed. The default value is 5.
        .withAnrMonitoringTimeout(7)
        .build();
// Initializing the AppMetrica SDK.
AppMetrica.activate(getApplicationContext(), config);
// Creating an extended library configuration.
val config = AppMetricaConfig.newConfigBuilder(API_KEY)
    // Enabling ANR monitoring. The default value is false.
        .withAnrMonitoring(true)
        // Override the ANR timeout if needed. The default value is 5.
        .withAnrMonitoringTimeout(7)
    .build()
// Initializing the AppMetrica SDK.
AppMetrica.activate(applicationContext, config)

Report period

You can view the report for a certain day or generate it for a specific time period.

To set a custom reporting period, use the button. The selected time interval can be grouped by hours, days, weeks, or months.

Grouping data

The data in the report can be grouped by:

  • ANR group
  • App version
  • Device
  • OS version
  • Manufacturer

Metrics

The following metrics are available for analysis:

  • ANRs: The number of errors.
  • Devices: The number of devices that registered an error at least once during the selected time period.
  • % of all devices: The percentage of devices that registered the error out of the total number of devices running the app during the selected time period.
  • Detected in version: The app version where the error was registered for the first time.
  • Last reproduction: The app version where the error was last registered.

You can access the ANR group details page. To do this, click on the ANR group name in the upper-right corner.

ANR symbolication

Note

You can't rebuild mapping files for the previous builds. However, if you have archives generated by our crash plugin for previous builds, you can upload them manually.

If the mapping or dSYM file was not uploaded during the app build process, a warning about unsymbolicated ANRs will appear in the group list.

How to symbolicate ANRs:

To upload mapping files:

  1. Open SettingsCrashes.
  2. Make sure that file upload is selected for Android.
  3. Select the file to upload.

You can view the list of missing files on the SettingsCrashes page of your app in AppMetrica.

Upload dSYM files on iOS. You can view the list of missing files on the SettingsCrashes page of your app in AppMetrica.

Viewing the ANR log

To view the log:

  1. Select the ANR group from the list on the page.
  2. In the table, click Open ANR log.

The log displays device information and the ANR details.

Go to the profile card from the log to see the events that preceded the ANR. To do this, click View session events.

Adding a comment

You can add a comment to the ANR if needed. This can be useful if the report is viewed by multiple developers. For example, you can add a link to an issue in a comment in Yandex Tracker.

To add a comment, open the appropriate group and enter your text in the Comment field.

Closing ANRs

Close fixed ANRs to remove them from the report. Closed ANRs will be automatically reopened if they are detected in versions where they were not previously found.

To close an ANR, open the relevant group. In the top right corner, set the ANR group status to Closed.

Data export

You can export the ANR log description as a TXT file. To do this, open the relevant ANR group and click Open ANR logExport.

Learn more

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

Contact support