Crashes, ANRs and observability

5 concepts · 15 practice questions

Crash reporting

A crash reporter such as Crashlytics groups crashes by cause and release. Release builds are obfuscated by R8, so the mapping file must be uploaded to read stack traces. Non-fatal reports count the failures you caught. Custom keys and logs add the context a stack trace lacks.

try {
    paymentClient.charge(order)
} catch (e: PaymentException) {
    Firebase.crashlytics.setCustomKey("provider", order.provider)
    Firebase.crashlytics.recordException(e) // non-fatal
    showRetry()
}

Also covered

ANRs
StrictMode
Profiling and benchmarks
Release health and Play vitals

Sign in to read the rest and take the 15-question test.

Sign in to continue