HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center

Disabling/Enabling Crash Reporting for Android

This page details the API for disabling and enabling crash reporting for your Android apps.

Instabug Crash Reporting can be disabled with the following method. This will completely prevent any crash report from being sent to your dashboard. By default, crash reporting is enabled if it is available in your current plan.

// Enable
CrashReporting.setState(Feature.State.ENABLED);
// Disable
CrashReporting.setState(Feature.State.DISABLED);
// Enable
CrashReporting.setState(Feature.State.ENABLED)
// Disable
CrashReporting.setState(Feature.State.DISABLED)

Disable ANR Crashes

By default, if Crash Reporting is enabled, Instabug captures any ANR that occurs within your app, along with the stack trace of the crash. You can disable reporting ANR Crashes using the following API.

CrashReporting.setAnrState(Feature.State.DISABLED);
CrashReporting.setAnrState(Feature.State.DISABLED)

Enable NDK Crashes

In order to start capturing NDK crashes, you'll need to add the below dependency to your app-level gradle.

implementation 'com.instabug.library:instabug-ndk-crash:11.8.0'

By default, NDK crash reporting is disabled. However, you can enable them using the following API.

CrashReporting.setNDKCrashesState(Feature.State.ENABLED);
CrashReporting.setNDKCrashesState(Feature.State.ENABLED)