Setup with Hilt, Metro, or manual DI
This guide shows how to set up the Kotzilla SDK in an app that does not use Koin: Hilt, Metro, Dagger, or manual DI. Since SDK 2.3.0 this is supported natively, and the steps below cover Android, KMP, and Compose Multiplatform in one place.
Before starting, your application must be registered on the Kotzilla Platform:
- Recommended: via the Kotzilla MCP Server. It performs this entire setup for you from your AI coding assistant, detects that your app does not use Koin, and applies every step below automatically.
- Using the Koin IDE Plugin or the Kotzilla Console if you prefer to set it up by hand.
What Kotzilla captures without Koin
With Koin, Kotzilla sees your app's structure (the dependency graph, components, and bindings) and detects the issues that come from it: main-thread and background-thread performance. It also correlates these with the symptoms listed below (slow screens, ANRs, crashes, and startup) to pinpoint the component or dependency at their root cause. That structural visibility is not yet available for other DI frameworks. It is on our roadmap.
Everything else works the same. On a Hilt, Metro, Dagger, or manual-DI app you still get:
- Sessions, cold and warm startup metrics
- Per-screen render times, with Compose Navigation 2 and 3 routes auto-detected
- ANRs and crashes (with symbolication)
- Lifecycle and timeline events
Step 1 - Setup Kotzilla SDK
1.1 Kotzilla project configuration file
Download the kotzilla.json file for your app and place it in your module:
- Android app: your app module (
<project>/<app-module>) - KMP / CMP: your shared module (
<project>/<shared-module>), and add"isDefault": trueto the key entry. See Using the isDefault property.
1.2 Set up the SDK
Add the SDK and plugin to your libs.versions.toml (use kotzilla-sdk-compose if your app uses Compose):
[versions]
kotzilla = "2.3.3" // Check the latest version available below
[libraries]
kotzilla-sdk-compose = { group = "io.kotzilla", name = "kotzilla-sdk-compose", version.ref = "kotzilla" }
[plugins]
kotzilla = { id = "io.kotzilla.kotzilla-plugin", version.ref = "kotzilla" }
Set up the Kotzilla Plugin in your project root-level Gradle file (<project>/build.gradle.kts):
plugins {
alias(libs.plugins.kotzilla) apply true
}
Then apply it in the module that ships the SDK, your app module on Android or your shared module on KMP/CMP, and set your app version there. In that module's build.gradle.kts:
plugins {
alias(libs.plugins.kotzilla)
}
kotzilla {
versionName = "1.0.0" // Your app version
}
The SDK dependency is added automatically by the plugin. No manual implementation line needed.
Android auto-start relies on a ContentProvider the plugin injects into the application module. Root-level apply true above covers this. If you apply the plugin per module instead, make sure the Android application module is one of them, or the SDK never boots and no sessions arrive, silently.
The kotzilla {} block supports more options (composeInstrumentation, autoAddDependencies, uploadMappingFile, and others). See Kotzilla Gradle plugin configuration for the full reference.
1.3 Projects using KSP
If any part of your build uses KSP, for example Hilt, Dagger, Room, or Moshi, the plugin generates config on the same Kotlin source set KSP reads, and neither declares the dependency, so the build fails validation. Add task ordering so config generation runs first:
subprojects {
tasks.matching { it.name.startsWith("ksp") }.configureEach {
dependsOn(tasks.matching { it.name.startsWith("generateKotzillaConfig") })
}
}
1.4 Sync Gradle
Sync your project in Android Studio or IntelliJ IDEA to apply the changes.
Builds print the Kotzilla report for the selected app version. By default a FAIL status does not block the build (the report is informational). To turn it into a hard build gate, set kotzilla { skipBuildReportFailure = false }, or override it per build from CI/CD with -Pkotzilla.skipBuildReportFailure=false. See Kotzilla Gradle plugin configuration for details.
Step 2 - Start Kotzilla SDK
Without a Koin container, the SDK is started differently per target.
Android: nothing to do. The SDK boots automatically at process start, before Application.onCreate.
KMP and CMP (iOS, Desktop, Web): add a shared wrapper in commonMain and call it once from each platform entry point. The wrapper must return Unit, because monitoring() returns KotzillaCore, which is not on downstream modules' classpaths:
// commonMain
import io.kotzilla.generated.KotzillaGeneratedConfig
import io.kotzilla.generated.monitoring
fun startKotzillaMonitoring() {
monitoring(KotzillaGeneratedConfig.version)
}
- iOS: from
initApp()(invoked from Swift) - Desktop: at the top of
main() - Web (JS and WasmJS): at the top of
main()
SDK libraries (Android): call monitoring(version) from your library's init entry point.
Step 3 - Go To Dashboard
Build and run your app to capture a first session, then open the Kotzilla Console to confirm the data arrived.
A green build does not prove the SDK started on this path. Set kotzilla { displayLogs = true }, relaunch, and watch the SDK logs.
Questions or issues during setup? Contact us. We are here to help!