Skip to main content

Gradle build troubleshooting

This page covers build-time issues you may hit when the Kotzilla Gradle plugin runs alongside your own custom Gradle tasks. For the plugin's configuration options, see Kotzilla Gradle plugin configuration.

A build task conflicts with a Kotzilla task​

Symptom​

Your build fails with a Gradle work-validation error such as:

Reason: Task ':your-module:generateKotzillaBuildIdRelease' uses this output of task
':your-module:yourTask' without declaring an explicit or implicit dependency.
This can lead to incorrect results being produced, depending on what order the tasks are executed.

Cause​

This happens when one of your own build tasks generates files into a source directory — for example src/main/assets, src/main/res, src/main/java, src/main/kotlin, or src/commonMain/…. Common culprits are asset packagers, resource generators, and code generators (protobuf/gRPC, OpenAPI, jOOQ, ANTLR, and similar).

The Kotzilla plugin reads your source directories to compute a stable build identifier, so Gradle asks you to declare the ordering between your generating task and Kotzilla's task.

note

This is a coupling between your task and Kotzilla's, not a Kotzilla bug in your app — nothing ships incorrectly. It only needs an explicit ordering so Gradle knows which task runs first.

Fix​

Add one of the following to the build script of the module that owns both tasks (the module named in the error). Put it at the top level of the file.

Option 1 — declare the dependency (recommended). Kotzilla's build-id task will run after your generating task:

tasks.matching { it.name.startsWith("generateKotzillaBuildId") }
.configureEach { it.dependsOn("yourTask") }

Option 2 — order only, without coupling execution. Use this if you don't want Kotzilla's task to trigger yours:

tasks.matching { it.name.startsWith("generateKotzillaBuildId") }
.configureEach { it.mustRunAfter("yourTask") }

Option 3 — generate outside src/ (cleanest long-term). Have your task write into build/generated/… and register that as a generated source directory, so its output lives outside the tracked source tree entirely:

// Android
android.sourceSets.getByName("main").assets.srcDir(layout.buildDirectory.dir("generated/my-assets"))
tip

tasks.matching { it.name.startsWith("generateKotzillaBuildId") } covers every build variant in one statement (generateKotzillaBuildIdDebug, generateKotzillaBuildIdRelease, and so on). Replace "yourTask" with the exact task name from the error message.

NoSuchMethodError during Kotlin compilation (Compose)​

Symptom​

Kotlin compilation fails with a compiler error (note the e: prefix and the io.kotzilla.gradle.kcp frames):

e: java.lang.NoSuchMethodError: 'java.util.List org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.getParameters()'
at io.kotzilla.gradle.kcp.DefaultPluginContextUtils.referenceFunctionByRegularParameterNames(...)
at io.kotzilla.gradle.kcp.ComposeNavHostExtension.generate(...)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(...)

On Kotlin 2.1.20 / 2.1.21 the error names a different method, and only appears for screens that call remember, rememberSaveable, LaunchedEffect or DisposableEffect, which is most of them:

e: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.expressions.impl.IrGetObjectValueImpl org.jetbrains.kotlin.ir.builders.ExpressionHelpersKt.irUnit(org.jetbrains.kotlin.ir.builders.IrBuilder)'

Cause​

SDK 2.2.0+ requires Kotlin 2.2.0 or newer to instrument Compose. The Kotzilla Kotlin compiler plugin is built against the Kotlin 2.2 compiler API. Kotlin 2.1.0 / 2.1.10 (and 2.0.x) lack part of that API (IrFunction.parameters), and Kotlin 2.1.20 / 2.1.21 have it but with different signatures for other compiler helpers the plugin uses, so the compiler throws NoSuchMethodError while instrumenting a Compose module. This is a plugin/compiler compatibility issue — not an error in your code.

Fix​

Pick one:

  • Upgrade Kotlin to 2.2.0+ (recommended): set kotlin = "2.2.0" (or newer) in your libs.versions.toml.
  • Keep Kotlin 2.1.x and disable Compose instrumentation: kotzilla { composeInstrumentation = false }. The SDK then builds on Kotlin 2.1.x; you keep Koin tracking, crash reporting, and lifecycle, and only lose automatic Compose screen/navigation tracking.
  • Stay on SDK 2.1.5 if you need Compose auto-tracking and cannot move your Kotlin version yet.

See SDK version upgrades — From 2.1.x to 2.2.x for details.

NoClassDefFoundError: ComponentRegistrar on Kotlin 2.4.20​

Symptom​

After upgrading to Kotlin 2.4.20, Kotlin compilation fails in every module the Kotzilla plugin is applied to, including modules without Compose:

java.lang.NoClassDefFoundError: org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar

Cause​

Kotlin 2.4.20 removed the ComponentRegistrar compiler API. The Kotzilla Kotlin compiler plugin in SDK 2.3.6 and earlier still uses it, so the compiler cannot load the plugin. kotzilla { composeInstrumentation = false } does not help: the plugin is still loaded, it just skips instrumentation.

Fix​

  • Stay on Kotlin 2.4.10 until you upgrade to SDK 3.0, which supports Kotlin 2.4.20.

R8 fails with Missing class android.app.ApplicationStartInfo​

Symptom​

With SDK 2.3.4 to 2.3.6, a release build with minification enabled fails in minify<Variant>WithR8 when the app compiles against Android API 34 or lower (compileSdk = 34):

Missing class android.app.ApplicationStartInfo (referenced from: void io.kotzilla.sdk.AndroidStartupMarks.onApplicationStartInfo(...) and 2 other contexts)

Cause​

The SDK reads app startup information through ApplicationStartInfo, an Android 15 (API 35) class. It only calls it on Android 15+ devices, but R8 checks every referenced class against your compileSdk at build time, and SDK 2.3.4 to 2.3.6 do not tell R8 the class may be missing.

Fix​

Pick one:

  • Add a rule to your app's proguard-rules.pro:

    -dontwarn android.app.ApplicationStartInfo

    This is safe: the SDK never uses the class on devices below Android 15.

  • Compile against API 35 or newer (compileSdk = 35). Your minSdk and targetSdk can stay unchanged.

SDK 3.0 ships this rule, so no action is needed after upgrading.

Controlling when Kotzilla tasks run​

By default, the plugin attaches a few tasks to your assemble/bundle lifecycle so they "just work" — a ProGuard mapping upload and a build report. If you run a release build for a reason that does not need them (a local smoke build, an APK-only CI job, an offline build), you can turn them off:

BehaviourHow to disable
ProGuard mapping upload after assemble/bundlekotzilla { uploadMappingFile = false }
Build report network call after assemblekotzilla { buildReport = false }
Build report on an offline buildrun Gradle with --offline (the report call is skipped)
Any single Kotzilla task, one invocation only--exclude-task <taskName>, e.g. --exclude-task uploadMappingFileRelease
All Kotzilla plugin behaviour in a modulekotzilla { enabled = false }

See Kotzilla Gradle plugin configuration for the full DSL.

Known limitations​

ProGuard mapping comment on AGP 8.13+​

On Android Gradle Plugin 8.13 and later, the plugin no longer writes its build-identifier comment into mapping.txt (AGP finalizes the published mapping file in a step that runs after the point where Kotzilla would annotate it).

This has no impact on crash symbolication or issue detection. The build identifier is still delivered to Kotzilla through the session data and the mapping upload, so nothing is lost — the in-file comment was only a convenience. No action is required.

note

If you inspect your mapping.txt on AGP 8.13+ and don't find a Kotzilla build-id comment, that is expected and not an error.