Skip to content

Gradle plugin

The Cimka Gradle plugin writes the list of your app’s runtime dependencies (with versions) into the APK at build time. The SDK uploads it once per app version so the dashboard can show exactly which libraries each release ships.

Without the plugin, the SDK falls back to scanning class names, which gives no versions and finds almost nothing in minified builds.

The plugin is resolved from the same GitHub Packages repository, so add it to pluginManagement too:

settings.gradle.kts
pluginManagement {
repositories {
google()
gradlePluginPortal()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/cimka-resource/cimka-sdk-android")
credentials {
username = providers.gradleProperty("gpr.user").getOrElse(System.getenv("GITHUB_ACTOR") ?: "")
password = providers.gradleProperty("gpr.key").getOrElse(System.getenv("GITHUB_TOKEN") ?: "")
}
}
}
}
build.gradle.kts (root)
plugins {
id("com.xhonaldo.cimka.source-context") version "1.0.4" apply false
}
app/build.gradle.kts
plugins {
id("com.android.application")
id("com.xhonaldo.cimka.source-context")
}
cimkaSourceContext {
enabled.set(true) // default
}

Apply it only to com.android.application modules.

For every variant it registers cimkaGenerateDependencyList<Variant> (group cimka), which writes assets/cimka_dependencies.json:

[
{ "package": "com.squareup.okhttp3:okhttp", "version": "5.3.0" },
{ "package": "androidx.core:core-ktx", "version": "1.17.0" }
]

Verify it in a built APK:

Terminal window
unzip -p app/build/outputs/apk/release/*.apk assets/cimka_dependencies.json