Skip to main content

Issue detection (7.x Beta)

7.x Beta

This page documents a subsystem that is new in 7.x and has no 6.x equivalent. The 7.x line is currently in beta — APIs and option defaults may still evolve.

Overview

7.x introduces a dedicated detection subsystem that observes the running app and reports behavior deviations as issues. Five independent providers ship with the SDK:

ProviderWhat it detects
CrashUncaught JVM (Java/Kotlin) exceptions
Native crashNative (NDK) crashes via Breakpad
HangUI thread stalls that exceed the hang threshold
Abnormal exitProcess terminations reported by ActivityManager.getHistoricalProcessExitReasons() — including ANRs, low-memory kills, and other unexpected terminations aligned with the Google Play Console "vitals" model
Main-thread misuseBlocking I/O, network, database, or SharedPreferences work performed on the UI thread

Every provider is independently toggleable through SDK options or the AndroidManifest.xml <meta-data> equivalents. Crash and native crash configuration are covered on the dedicated crash reports page — this page focuses on the non-crash providers (hang, abnormal exit, main-thread misuse) and the shared reference table.

info

Because each provider is gated by its own option, you can enable or disable any of them in isolation without affecting the rest of the SDK. Defaults are conservative — several providers are off by default in 7.x Beta and must be explicitly enabled.

Hang detection

The hang provider watches for situations where the main thread becomes unresponsive long enough to degrade the user experience, but the OS has not yet raised an ANR. When a hang is detected, Bugsee captures a stack trace of the main thread along with the usual video, logs, and network context, and produces an issue.

Enable hang detection

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

Hang detection is disabled by default. Enable it on internal / beta builds first to tune for your app's real-world main-thread behavior before rolling out to production.

Option keys: DetectAndReportHang (com.bugsee.option.detect.hang).

Abnormal exit detection

Abnormal exit detection surfaces process terminations that the user would otherwise never see — ANRs, low-memory kills, excessive-resource-usage kills, and other unexpected ends of the app process. It is powered by Android's ActivityManager.getHistoricalProcessExitReasons() API and aligns with the termination reasons reported by the Google Play Console Android vitals dashboard.

note

Abnormal exit detection is layered: the master switch DetectAndReportExit enables the provider, and a set of per-reason sub-flags lets you narrow down which termination reasons are reported. The sub-flags are only consulted when the master switch is on.

Enable abnormal exit detection

<!-- Master switch -->
<meta-data android:name="com.bugsee.option.detect.exit"
android:value="true" />

<!-- Optional: opt into additional exit reasons -->
<meta-data android:name="com.bugsee.option.detect.exit.excessive_resource_usage"
android:value="true" />
<meta-data android:name="com.bugsee.option.detect.exit.user_requested"
android:value="true" />

By default, when the master switch is enabled, two reasons are reported: low memory kills (DetectAndReportExitLowMemory, true) and not responding / ANR (DetectAndReportExitNotResponding, true). All other per-reason flags default to false and must be opted in.

The full set of per-reason sub-flags is listed in the reference table below.

Main-thread misuse

Main-thread misuse detects I/O, network, database, or SharedPreferences operations executed on the UI thread — the kind of work that directly causes jank, hangs, and ANRs. When a violation is observed, Bugsee reports an issue with the offending stack trace.

Requires the Bugsee Gradle plugin

Main-thread misuse is powered by bytecode instrumentation performed by the Bugsee Gradle plugin's mainThreadMisuse transform. The plugin injects lightweight pre-call checks before guarded I/O, network, DB, and SharedPreferences operations, and the checks bridge to BugseeMainThreadGuardAdapter at runtime. Without the Gradle plugin, setting the option alone has no effect.

See the Gradle plugin page for setup instructions.

Enable main-thread misuse detection

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

Option keys: DetectAndReportMainThreadMisuse (com.bugsee.option.detect.main_thread_misuse).

Early detection

Some crashes happen so early in process startup that they occur before the SDK's regular launch() has completed wiring up its handlers. DetectAndReportEarlyCrash installs the crash handler in the SDK's auto-init phase (via BugseeInitProvider) so that these very-early failures can still be captured.

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

Option keys: DetectAndReportEarlyCrash (com.bugsee.option.detect.early-crash). Disabled by default.

HTTP errors as issues

When enabled, the SDK treats failed HTTP responses (e.g. 4xx / 5xx) as reportable issues in their own right, in addition to being recorded as breadcrumbs on regular reports. Use this to surface backend regressions without relying on a user submitting a bug.

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

Option keys: DetectAndReportHttpErrors (com.bugsee.option.detect.http-errors). Disabled by default.

All detection option keys

The table below is the complete set of detection options recognized by the 7.x Beta SDK. Any of them can be set programmatically via Options.* constants or in AndroidManifest.xml as <meta-data> entries. Programmatic values take precedence. For the general option mechanism see configuration.

Options constantManifest keyTypeDefault
DetectAndReportCrashcom.bugsee.option.detect.crashbooleantrue
DetectAndReportCrashNdkcom.bugsee.option.detect.crash-ndkbooleanfalse
DetectAndReportEarlyCrashcom.bugsee.option.detect.early-crashbooleanfalse
DetectAndReportHangcom.bugsee.option.detect.hangbooleanfalse
DetectAndReportMainThreadMisusecom.bugsee.option.detect.main_thread_misusebooleanfalse
DetectAndReportHttpErrorscom.bugsee.option.detect.http-errorsbooleanfalse
DetectAndReportExitcom.bugsee.option.detect.exitbooleanfalse
DetectAndReportExitLowMemorycom.bugsee.option.detect.exit.low_memorybooleantrue
DetectAndReportExitNotRespondingcom.bugsee.option.detect.exit.not_respondingbooleantrue
DetectAndReportExitExcessiveResourceUsagecom.bugsee.option.detect.exit.excessive_resource_usagebooleanfalse
DetectAndReportExitDependencyDiedcom.bugsee.option.detect.exit.dependency_diedbooleanfalse
DetectAndReportExitUserRequestedcom.bugsee.option.detect.exit.user_requestedbooleanfalse
DetectAndReportExitUserWasStoppedcom.bugsee.option.detect.exit.user_was_stoppedbooleanfalse
DetectAndReportExitPermissionChangedcom.bugsee.option.detect.exit.permission_changedbooleanfalse
DetectAndReportExitPackageUpdatedcom.bugsee.option.detect.exit.package_updatedbooleanfalse
DetectAndReportExitPackageStateChangedcom.bugsee.option.detect.exit.package_state_changedbooleanfalse
DetectAndReportExitOthercom.bugsee.option.detect.exit.otherbooleanfalse
DetectAndReportExitUnknowncom.bugsee.option.detect.exit.unknownbooleanfalse
See also