SDK setup with Version Catalog
In this section, you’ll find detailed, step-by-step instructions for setting up the Kotzilla SDK using the Gradle Version Catalog, which is a recommended way to centrally manage your dependencies and plugins in modern Kotlin and Android projects. This method simplifies version management and helps maintain consistency across multiple modules in your application.
This section replaces the "Update Gradle Files" steps described in the default Kotzilla SDK setup guides for Android, KMP and SDK libraries
Before you begin configuring the Kotzilla SDK with the Gradle Version Catalog, make sure you have registered your application in the Kotzilla Console. Download the corresponding kotzilla.json file from your project dashboard. This file contains the configuration data needed to initialize the SDK properly and enables accurate tracking of your app’s performance.
When using the Version Catalog, please setup the Kotzilla public repository first to resolve dependencies correctly. More information on how to configure access to the Kotzilla repository is available here
Update libs.versions.toml
To set up the SDK using the Version Catalog, add the following lines to your libs.versions.toml file:
[versions]
kotzilla = "1.1.0"
[libraries]
kotzilla-sdk = {group = "io.kotzilla", name = "kotzilla-sdk", version.ref = "kotzilla" }
# if needed ktor3 engine
# kotzilla-sdk-ktor3 = {group = "io.kotzilla", name = "kotzilla-sdk-ktor3", version.ref = "kotzilla" }
[plugins]
kotzilla = { id = "io.kotzilla.kotzilla-plugin", version.ref = "kotzilla" }
Make sure that all three sections above are included
Root Project - build.gradle.kts
Set up the Kotzilla Plugin in your project (root-level) Gradle file (<project>/build.gradle.kts)
:
plugins {
alias(libs.plugins.kotzilla) apply false
}
App Level - build.gradle.kts
Configure your module (app-level) Gradle file (<project>/<app-module>/build.gradle.kts)
with Version Catalog Gradle dependencies, within plugins
section and dependencies
section:
plugins {
alias(libs.plugins.kotzilla)
}
dependencies {
implementation(libs.kotzilla.sdk)
// if you use ktor3
// implementation(libs.kotzilla.sdk.ktor3)
}
Sync your project with your Gradle configuration. Your dependencies should now resolve correctly.