Public preview · Registration and live billing are not open.
Anti-AIClonePILOT

Log date · Mon

Kotlin 2.4.20: annotations in JVM metadata by default, and other metadata changes

Kotlin 2.4.20 enabled annotations in JVM metadata by default and added metadata flags, so teams should re-check what metadata their release builds carry.

What happened on this date

At 2026-09-07T10:31Z (UTC), the JetBrains/kotlin repository published Kotlin 2.4.20, and the JetBrains blog posted the release overview the same day. Changelog items that affect compiled output include KT-75736, enabling reading and writing of annotations in metadata on the JVM by default; KT-84802, a new synthetic class flag in JVM metadata; and KT-86464, extending the isPublicAbi metadata flag to anonymous and synthetic local classes. Other items include incremental compilation on by default for Kotlin/Native (KT-86657), range checks on by default for Kotlin/Wasm (KT-73452), deprecation of the K1 compiler (KT-75372), and Swift export support for sealed classes and cross-language subtyping. The blog also mentions Build Tools API support for Kotlin metadata targets and Gradle 9.7.0 support.

Why it matters for protecting app logic

Kotlin metadata records source-level declaration information, and decompilers often use it to reconstruct Kotlin-style signatures; on Android, R8 processes this metadata according to keep rules. A change in compiler defaults means the metadata in your release package can differ even if you changed no code. Caution is warranted: the changelog entries are terse and say neither exactly what additional data is written nor how it interacts with R8, so we make no judgment about the size of the effect and recommend measuring instead. For KMP projects, the interfaces produced by Swift export become a visible public surface in the iOS binary and belong in the same inventory.

Checks you can run

First, land the Kotlin upgrade as a separate change and build a release APK or AAB before and after, comparing metadata annotations and retained class names in the class files. Second, confirm that R8's metadata handling and your keep rules still behave as intended, especially in modules that use reflection or serialization. Third, for KMP projects, check whether public symbols produced by Swift export expose internal concepts unnecessarily. Fourth, run the full test suite on the minified release build, not only on debug builds. Keep the before-and-after comparison with the release record so later audits can see what changed.

Your checklist

  • Diff Kotlin metadata and class names in release builds before and after upgrading
  • Confirm R8 metadata handling and keep rules still behave as intended
  • Review public symbols exposed by Swift export

Primary sources

All sources and reproduction status ↗