Skip to main content

Crashes (7.x Beta)

7.x Beta

APIs and defaults may still change before the 7.0 stable release.

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

FormSetting
Manifest meta-data<meta-data android:name="com.bugsee.option.detect.crash" android:value="true" />
Bugsee.launch() mapoptions.put(Options.DetectAndReportCrash, true)
Defaulttrue
AndroidManifest.xml — disable JVM crash capture
<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 that they fire before Bugsee.launch() has wired its handler. The DetectAndReportEarlyCrash option arms the handler in the SDK's auto-init phase (via BugseeInitProvider) so these very-early failures are still captured.

FormSetting
Manifest meta-data<meta-data android:name="com.bugsee.option.detect.early-crash" android:value="true" />
Bugsee.launch() mapoptions.put(Options.DetectAndReportEarlyCrash, true)
Defaultfalse

Early-crash detection is mainly useful when you initialise Bugsee programmatically (rather than via the manifest auto-init) and need coverage for crashes that happen in Application.onCreate() before your Bugsee.launch(...) call runs.

Report a caught exception

Use Bugsee.logException(...) for exceptions you have already caught but still want to surface as a standalone Bugsee issue:

try {
doWork();
} catch (Exception ex) {
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);
Thread.setDefaultUncaughtExceptionHandler((thread, 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.

Thread.UncaughtExceptionHandler previous =
Thread.getDefaultUncaughtExceptionHandler();

Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> {
Bugsee.onUncaughtException(thread, ex);
if (previous != null) 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:

TaskWhen it runsPurpose
uploadBugsee<Variant>MappingAfter 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

Found an issue, typo, or wrong statement on this page? Report it now →