Skip to main content

Crash reports (7.x Beta)

7.x Beta

This page documents the 7.x beta of the Bugsee Android SDK. APIs and defaults may change before the stable release. For the production API, see the 6.x crash reports guide.

Bugsee installs its crash handlers at Bugsee.launch() time and uploads the report on the next app start. Java/Kotlin exceptions and native (NDK) crashes are both supported.

Automatic coverage

SurfaceOption constantManifest keyDefault
Java / Kotlin uncaught exceptionsOptions.DetectAndReportCrashcom.bugsee.option.detect.crashtrue
Native crashes (NDK, Breakpad)Options.DetectAndReportCrashNdkcom.bugsee.option.detect.crash-ndkfalse
Early crashes (before launch() completes)Options.DetectAndReportEarlyCrashcom.bugsee.option.detect.early-crashfalse

Java crash detection is on by default. Native crash detection ships with the SDK but is disabled by default; enable it in your manifest if your app includes native code:

<meta-data android:name="com.bugsee.option.detect.crash-ndk"
android:value="true" />

Native crashes are captured via Google Breakpad (see library/jni/crash/bugsee_crash_handler*.cc). The handler writes a minidump, which the SDK packages alongside the Java-side session data on the next launch.

For ANR, hang, abnormal-exit, and main-thread-misuse detection, see the detection guide.

Report a caught exception

Use 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, Serializable> of extra attributes attached to the report:

static void logException(Throwable ex);
static void logException(Throwable ex, Map<String, Serializable> options);

Forward an unhandled exception

Bugsee.logUnhandledException(Throwable) is new in 7.x for apps that install their own top-level Thread.UncaughtExceptionHandler. Call it fire-and-forget before rethrowing or terminating the process:

Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> {
Bugsee.logUnhandledException(throwable);
// forward to your next handler or let the process die
});

Unlike logException, logUnhandledException records the throwable with the same fatal priority the SDK would have used if it had caught the crash directly.

Crash interop

When another crash SDK (Crashlytics, Sentry, Instabug, etc.) 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 does not 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

The Bugsee Gradle plugin uploads the artifacts needed to deobfuscate and symbolicate stack traces as part of your build:

TaskWhen it runsPurpose
uploadBugsee<Variant>MappingAfter assemble<Variant> / bundle<Variant>Uploads the ProGuard / R8 mapping.txt for Java/Kotlin stack traces.
uploadBugsee<Variant>NativeAfter assemble<Variant> / bundle<Variant> when bugsee { ndk(true) }Uploads NDK native debug symbols so Breakpad minidumps can be symbolicated.

Enable native symbol upload in your module's build.gradle(.kts):

bugsee {
ndk(true)
}

Maven-based builds cannot register these tasks; upload mappings and native symbols manually through the Bugsee dashboard or REST API.