Issue detection (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:
| Provider | What it detects |
|---|---|
| Crash | Uncaught JVM (Java/Kotlin) exceptions |
| Native crash | Native (NDK) crashes via Breakpad |
| Hang | UI thread stalls that exceed the hang threshold |
| Abnormal exit | Process terminations reported by ActivityManager.getHistoricalProcessExitReasons() — including ANRs, low-memory kills, and other unexpected terminations aligned with the Google Play Console "vitals" model |
| Main-thread misuse | Blocking 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.
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
- AndroidManifest.xml
- Programmatic
<meta-data android:name="com.bugsee.option.detect.hang"
android:value="true" />
HashMap<String, Object> options = new HashMap<>();
options.put(Options.DetectAndReportHang, true);
Bugsee.launch(this, "<APP_TOKEN>", options);
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.
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
- AndroidManifest.xml
- Programmatic
<!-- 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" />
HashMap<String, Object> options = new HashMap<>();
options.put(Options.DetectAndReportExit, true);
options.put(Options.DetectAndReportExitExcessiveResourceUsage, true);
options.put(Options.DetectAndReportExitUserRequested, true);
Bugsee.launch(this, "<APP_TOKEN>", options);
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.
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
- AndroidManifest.xml
- Programmatic
<meta-data android:name="com.bugsee.option.detect.main_thread_misuse"
android:value="true" />
HashMap<String, Object> options = new HashMap<>();
options.put(Options.DetectAndReportMainThreadMisuse, true);
Bugsee.launch(this, "<APP_TOKEN>", options);
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.
- AndroidManifest.xml
- Programmatic
<meta-data android:name="com.bugsee.option.detect.early-crash"
android:value="true" />
HashMap<String, Object> options = new HashMap<>();
options.put(Options.DetectAndReportEarlyCrash, true);
Bugsee.launch(this, "<APP_TOKEN>", options);
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.
- AndroidManifest.xml
- Programmatic
<meta-data android:name="com.bugsee.option.detect.http-errors"
android:value="true" />
HashMap<String, Object> options = new HashMap<>();
options.put(Options.DetectAndReportHttpErrors, true);
Bugsee.launch(this, "<APP_TOKEN>", options);
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 constant | Manifest key | Type | Default |
|---|---|---|---|
DetectAndReportCrash | com.bugsee.option.detect.crash | boolean | true |
DetectAndReportCrashNdk | com.bugsee.option.detect.crash-ndk | boolean | false |
DetectAndReportEarlyCrash | com.bugsee.option.detect.early-crash | boolean | false |
DetectAndReportHang | com.bugsee.option.detect.hang | boolean | false |
DetectAndReportMainThreadMisuse | com.bugsee.option.detect.main_thread_misuse | boolean | false |
DetectAndReportHttpErrors | com.bugsee.option.detect.http-errors | boolean | false |
DetectAndReportExit | com.bugsee.option.detect.exit | boolean | false |
DetectAndReportExitLowMemory | com.bugsee.option.detect.exit.low_memory | boolean | true |
DetectAndReportExitNotResponding | com.bugsee.option.detect.exit.not_responding | boolean | true |
DetectAndReportExitExcessiveResourceUsage | com.bugsee.option.detect.exit.excessive_resource_usage | boolean | false |
DetectAndReportExitDependencyDied | com.bugsee.option.detect.exit.dependency_died | boolean | false |
DetectAndReportExitUserRequested | com.bugsee.option.detect.exit.user_requested | boolean | false |
DetectAndReportExitUserWasStopped | com.bugsee.option.detect.exit.user_was_stopped | boolean | false |
DetectAndReportExitPermissionChanged | com.bugsee.option.detect.exit.permission_changed | boolean | false |
DetectAndReportExitPackageUpdated | com.bugsee.option.detect.exit.package_updated | boolean | false |
DetectAndReportExitPackageStateChanged | com.bugsee.option.detect.exit.package_state_changed | boolean | false |
DetectAndReportExitOther | com.bugsee.option.detect.exit.other | boolean | false |
DetectAndReportExitUnknown | com.bugsee.option.detect.exit.unknown | boolean | false |
- Crash reports — Java/Kotlin and NDK crash setup, ProGuard/R8 mapping uploads.
- Configuration — how options are read at launch.
- Gradle plugin — required for main-thread misuse detection.