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)NdkOptions.DetectAndReport (in bugsee-android-ndk)com.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 (NDK) crash detection

Separate extension module since 7.0.0-beta6

NDK crash detection lives in its own extension module — com.bugsee:bugsee-android-ndk — and is not pulled in by bugsee-android itself. Add the dependency explicitly if your app includes native code:

dependencies {
implementation("com.bugsee:bugsee-android-ndk:7.x.x")
}

The Bugsee Gradle plugin does not auto-install this module; declare it manually. The option key com.bugsee.option.detect.crash-ndk is unchanged, and the corresponding programmatic constant is now com.bugsee.library.ndk.contracts.options.NdkOptions.DetectAndReport.

Once the extension is on the classpath, enable native crash detection in your manifest:

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

Native crashes are captured via Google Breakpad. The handler writes a minidump, which the SDK packages alongside the Java-side session data on the next launch. Starting in 7.0.0-beta6, NDK reports are also matched against historical ApplicationExitInfo records so the matching system tombstone (when available) is attached to the report as a ReportFile.TYPE_CRASH_TOMBSTONE entry.

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.