Skip to content

Android crash reports

AppeliumFeedback captures uncaught exceptions in your Android app and creates a crash report with the stack traces of the crashing thread and relevant other threads, the Activity that was visible and the activity log leading up to the crash. Upload your ProGuard or R8 mapping files to see deobfuscated stack traces. After the crash is recorded, the exception is passed on to Android's default handler, so your app terminates as it normally would.

What crash reports contain

Each crash report includes:

  • Stack traces for the crashing thread and relevant additional threads (noise threads such as JVM daemons are filtered out).
  • Application logs captured up to the moment of the crash.
  • Current Activity name visible at the time of the crash.
  • Resource usage averages (CPU and memory) for the session.
  • Crash metadata including crash timestamp, app launch timestamp, and a unique crash report identifier.

Enabling crash reporting

As all Appelium SDK features, crash reporting is off by default and needs to be explicitly enabled during Appelium initialization:

AppeliumFeedback.start(
    apiKey = <#api key#>,
    application = this,
    crashReporting = CrashReportingConfiguration.Enabled()
)

Debugger detection

Crash reporting is automatically disabled when a debugger is connected. This prevents the crash reporter from interfering with the debugger. If crash reports are not being captured during debugging, this is the expected behavior.

Note

After Appelium captures a crash, the exception is re-thrown to the system's default uncaught exception handler so that normal termination behavior is preserved.

Checking for crashes in the previous session

You can check whether the app crashed in the previous session using the hasCrashedInLastSession property. This is available immediately after start() returns:

if (AppeliumFeedback.hasCrashedInLastSession) {
    // React to previous crash, e.g. show a recovery message
}

Attaching data to crash reports

Optionally you can set a CrashesListener to attach additional data to crash reports. The listener must be set after calling start():

1
2
3
4
5
AppeliumFeedback.setCrashesListener(object : CrashesListener() {
    override fun crashReportAttachment(): ReportAttachment? {
        return ReportAttachment(fileName = "logs.txt", byteArray = myData)
    }
})

Note

Each file attachment is limited to 100KB. If longer data is passed, only the last 100KB will be used.

Attaching user identifiers

In order to attach a user identifier to each crash report you can use the following APIs:

AppeliumFeedback.setUserIdentifier(userIdentifier = "ABC-12345")

Note that the identifier is limited to max 50 characters.

Deobfuscation

In order to have crash reports properly deobfuscated, it is necessary to upload mapping files to Appelium. See Symbols Files REST APIs for more details.