F43nd1r edited this page Jul 2, 2018 · 72 revisions
  1. Prerequisites
  2. Dependenices
  3. Configuration

0. Prerequisites

This guide assumes you are using or later.

Acra requires java 8 (native, not RetroLambda or similar):

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

1. Dependencies

Everything you find in this section belongs into the dependencies block in your build.gradle:

dependencies {

Define ACRA Version

Add the following snippet (with the latest version)

def acraVersion = '5.1.3'

Choose sender

  • Http:
implementation "ch.acra:acra-http:$acraVersion"
  • Email:
implementation "ch.acra:acra-mail:$acraVersion"
  • Custom:
implementation "ch.acra:acra-core:$acraVersion"

More info: Report Destinations

Choose interaction

  • Dialog:
implementation "ch.acra:acra-dialog:$acraVersion"
  • Notification:
implementation "ch.acra:acra-notification:$acraVersion"
  • Toast:
implementation "ch.acra:acra-toast:$acraVersion"
  • Silent:

Add nothing.

More info: Interactions

Optional Plugins

  • Limiter: (limits how many reports acra sends from one device)
implementation "ch.acra:acra-limiter:$acraVersion"
  • Advanced Scheduler: [since 5.2.0-rc1] (controls when reports are sent (e.g. only on wifi) and can restart an application after a crash)
implementation "ch.acra:acra-advanced-scheduler:$acraVersion"

2. Configuration

If you don't already have an Application class, then create one. Apply the configuration to your Application class.

Creating an Application class

  • Create a new class in your package root.
  • Give it a name like: MyApplication extending from (or another subclass of that)
  • Update the application element in your AndroidManifest to reference the new class.

Configuring ACRA - Compile time

Add annotations to your Application class and override the attachBaseContext() method to add ACRA.init(this);. In our newly created class, it looks like:

    import org.acra.*;
    import org.acra.annotation.*;

    @AcraCore(buildConfigClass = BuildConfig.class)
    public class MyApplication extends Application {
        protected void attachBaseContext(Context base) {

            // The following line triggers the initialization of ACRA

I addition to the @AcraCore annotation, each plugin you added in the dependencies step provides another annotation, which you have to add to activate and configure that plugin:

For an example configuration see annotation example

Configuring ACRA - Runtime (Application start)

Construct a CoreConfigurationBuilder and pass it to ACRA.init:

CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this);
ACRA.init(this, builder);

Please note that plugins are disabled if their respective annotation is not present. You can activate them by calling:


For an example configuration see builder example

If you use both run- and compile-time configuration, compile-time values will serve as defaults for runtime configuration.

Available plugin builders:

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.