The Kotlin SDK is crash reporting and release health for native Android apps and plain JVM services. It catches uncaught Kotlin and Java exceptions on any thread and posts them in the same shapes the Flutter SDK sends, so a native Android crash and a Dart error land in the same Issues list and the same Release health numbers.
It is a pure Kotlin library. It does not depend on the Android SDK or AndroidX โ only the Kotlin standard library โ which is why the same artifact works in a server-side JVM app, and why adding it cannot drag a version conflict into your build.
Install and start
Through JitPack, which builds it from the public repo:
// settings.gradle.kts โ dependencyResolutionManagement.repositories
maven("https://jitpack.io")
// app/build.gradle.kts
implementation("com.github.Zaga-ltd.sentinel_packages:sentrinel_kotlin:main-SNAPSHOT")
Pin a commit instead of main-SNAPSHOT for release builds. Then, first thing in Application.onCreate():
Sentrinel.start(
Sentrinel.Options(
serverUrl = "https://api.sentrinel.dev",
appName = "shop", // the project โ the same app your backend reports into
env = "prod",
apiKey = BuildConfig.SENTRINEL_API_KEY, // a Mobile key
module = "android",
release = BuildConfig.VERSION_NAME,
),
storageDirectory = filesDir,
)
Pass storageDirectory = filesDir on Android. That line is the difference between crash reports that survive the crash and ones that do not. An earlier version looked for its storage in a JVM system property that is never set on Android, found nothing, and kept everything in memory โ so the one report that mattered died with the process. filesDir survives restarts and needs no permission.
A crash report that outlives the crash
When an uncaught exception reaches the handler, the report is written to disk and synced before the handler returns, and posted straight away โ the handler waits up to a second and a half for that post. If it gets through, the disk copy is removed. If not, the next launch sends it, and a replay that fails is kept and retried rather than deleted for having been read.
Then Android's own handler runs โ the crash dialog, the process kill โ always, even if writing the report failed. A crash reporter that swallows the crash, and leaves a frozen app on the user's screen, is worse than none. Starting the SDK twice reconfigures it; the handler is installed once, so a crash is never written twice.
Handled exceptions go through Sentrinel.captureError(e): reported as errors, with the session marked errored, not crashed.
The details that were wrong before
On Android, the JVM's os.name says linux and os.version is the kernel. Every Android device used to be reported as Linux 5.10. The OS version and model now come from android.os.Build, read by reflection so the library still does not depend on Android.
NaN and infinite values in context attributes are sent as null instead of failing the whole batch.
Sessions
One session per foreground stretch, for crash-free rate. The library does not depend on AndroidX, so the lifecycle is yours to wire โ four lines:
ProcessLifecycleOwner.get().lifecycle.addObserver(object : DefaultLifecycleObserver {
override fun onStop(owner: LifecycleOwner) = Sentrinel.onBackground() // ends the session, flushes
override fun onStart(owner: LifecycleOwner) = Sentrinel.onForeground() // same session within 30s
})
Without it, the OS killing your backgrounded app reads as an abnormal session. With it, those kills are the clean shutdowns they are.
Identity works like the other client SDKs: guest:<device id> per install until Sentrinel.identify(user.id), and Sentrinel.identityHeaders for requests to your own API. See Every install is someone.
What it does not do yet
- Native signal crashes and ANRs. ART delivers SIGSEGV and SIGABRT to the native layer, where pure Kotlin cannot reach; that needs a JNI handler.
- No ProGuard / R8 mapping upload, so obfuscated release stacks are not deobfuscated yet.
- No tracing, product events, custom metrics or
beforeSend.
The Kotlin README has the full reference, including the plain-JVM setup and building from source with includeBuild.