Crashes
The crash detector catches every uncaught Java / Kotlin exception in your app, builds a report from the SDK's session buffer (video, logs, breadcrumbs, network), and uploads it on the next process launch. The handler is installed at Bugsee.launch() time on top of any existing Thread.UncaughtExceptionHandler.
For native (NDK) crashes — separate detector, separate extension module — see Native crashes.
Configuration
| Form | Setting |
|---|---|
| Manifest meta-data | <meta-data android:name="com.bugsee.option.detect.crash" android:value="true" /> |
Bugsee.launch() map | options.put(Options.DetectAndReportCrash, true) |
| Default | true |
<meta-data android:name="com.bugsee.option.detect.crash"
android:value="false" />
Java crash detection is on by default; disable it only if another crash SDK on your build is already responsible for catching uncaught throwables (see Crash interop below).
Early crashes
Some crashes happen so early in process startup, before the first Activity is visible, that the app can crash again before their report is sent. The DetectAndReportEarlyCrash option is on by default: such a crash is detected on the next launch and its pending report is flushed synchronously before the app can crash again. Turning it off also disables the RelaunchedAfterCrash lifecycle event.
| Form | Setting |
|---|---|
| Manifest meta-data | <meta-data android:name="com.bugsee.option.detect.early-crash" android:value="false" /> |
Bugsee.launch() map | options.put(Options.DetectAndReportEarlyCrash, false) |
| Default | true |
Set it to false only if you do not want Bugsee to recover and flush startup crashes on the next launch.
Report a caught exception
Use Bugsee.logException(...) for exceptions you have already caught but still want to surface as a standalone Bugsee issue:
- Java
- Kotlin
try {
doWork();
} catch (Exception ex) {
Bugsee.logException(ex);
}
try {
doWork()
} catch (ex: Exception) {
Bugsee.logException(ex)
}
An overload accepts a Map<String, Object> of extra attributes attached to the report:
static void logException(Throwable ex);
static void logException(Throwable ex, Map<String, Object> options);
Forward an unhandled exception
Bugsee.logUnhandledException(Throwable, Map) is new in 7.x for apps that install their own top-level Thread.UncaughtExceptionHandler. Call it fire-and-forget before re-throwing or terminating the process — the throwable is recorded with the same fatal priority the SDK would have used if it had caught the crash directly. Pass null for the options map when you don't need to attach extra attributes:
static void logUnhandledException(Throwable ex, Map<String, Object> options);
- Java
- Kotlin
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> {
Bugsee.logUnhandledException(throwable, null);
// forward to your next handler or let the process die
});
Thread.setDefaultUncaughtExceptionHandler { _, throwable ->
Bugsee.logUnhandledException(throwable, null)
// forward to your next handler or let the process die
}
Crash interop
When another crash SDK (Crashlytics, Sentry, Instabug, …) also installs a Thread.UncaughtExceptionHandler, Bugsee exposes an explicit hand-off entry point:
static void onUncaughtException(Thread thread, Throwable ex);
Call this from the outermost handler you own so Bugsee sees the crash exactly once, then let your chain continue to the next SDK. The order of the chain is up to you — Bugsee doesn't require being first or last, but every active handler in the chain must be called from your own code.
- Java
- Kotlin
Thread.UncaughtExceptionHandler previous =
Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> {
Bugsee.onUncaughtException(thread, ex);
if (previous != null) previous.uncaughtException(thread, ex);
});
val previous = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { thread, ex ->
Bugsee.onUncaughtException(thread, ex)
previous?.uncaughtException(thread, ex)
}
Symbolication and mapping uploads
The Bugsee Gradle plugin registers per-variant tasks that upload the artefacts needed to deobfuscate Java / Kotlin stack traces:
| Task | When it runs | Purpose |
|---|---|---|
uploadBugsee<Variant>Mapping | After assemble<Variant> / bundle<Variant> | Uploads the ProGuard / R8 mapping.txt so obfuscated frames are deobfuscated on the dashboard. |
The task is on by default for release variants. Override variant scope via the Gradle plugin DSL (bugsee { buildInfo { allBuildTypes.set(true) } }) if you also want mapping uploaded for debug or custom build types.
Maven-based builds cannot register this task; upload mapping manually through the Bugsee dashboard or REST API.
See also
- Configuration → Detection — the option-key reference for all detection options including the crash-related ones.