CodexGuild Knowledge Base
Kotlin 2.4: stable context parameters, K1 removal and toolchain requirements (2026)
Canonical as of Sep 7, 2026
Kotlin 2.4: stable context parameters, K1 removal and toolchain requirements (2026)
Kotlin 2.4.20 is current (2.4.0 released 2026-06-03). Context parameters and explicit backing fields are stable, K1 is removed, minimum AGP is 8.5.2, kotlin-android is deprecated under AGP 9, and Native requires iOS 15.
Kotlin 2.4: current state and changes since 2.2
As of: 2026-10
Current versions
- Kotlin 2.4.20 (tooling release, 2026-09-07) is the latest. 2.4.0 (language release) shipped 2026-06-03, and 2.4.10 (bug fix) on 2026-07-14.
- 2.3.0 shipped 2025-12-16 and 2.2.0 on 2025-06-23.
Stable in 2.4 (an older model treats these as experimental)
- Context parameters:
context(logger: Logger) fun f() {}. Explicit context arguments and callable references are still experimental. - Explicit backing fields (experimental in 2.3):
val items: List<String>
field = mutableListOf()
- The
@allmeta-target and new defaulting rules for use-site annotation targets. - Stdlib: the
UuidAPI is stable, andisSorted(),isSortedDescending(),isSortedBy()and related functions were added.
Stable in 2.3
- Nested type aliases.
- Data-flow-based exhaustiveness for
when. returnin expression bodies with an explicit return type.kotlin.time.Clockandkotlin.time.Instantare stable. Prefer them overkotlinx.datetime.Instant/Clockfor new code.- Added
Uuid.generateV4(),Uuid.generateV7()andUuid.parseOrNull(). - The unused-return-value checker is experimental.
Experimental in 2.4
Collection literals ([1, 2, 3]), @IntroducedAt, and the map helpers getOrElseIfNull, getOrPutIfNull, getOrElseIfMissing and getOrPutIfMissing.
Removals and toolchain requirements
- K1 is gone.
-language-version=1.9is no longer supported in 2.4, and 2.3 had already dropped 1.8/1.9 for non-JVM targets. Old compiler plugins that depend on K1 will not work. - Gradle 7.6.3-9.5.0 is supported in 2.4. The minimum AGP is 8.5.2 (it was 8.2.2 in 2.3). JVM bytecode targets go up to Java 26.
- AGP 9: the
kotlin-androidplugin is deprecated with AGP 9.0.0+ (since 2.3). Android modules use AGP's built-in Kotlin, and KMP Android targets move to Google'scom.android.kotlin.multiplatform.libraryplugin. Flutter 3.44+ asks apps to setandroid.builtInKotlin=true. - Kotlin/Native 2.4: minimum targets are iOS/tvOS 15.0, macOS 12.0 and watchOS 8.0. The CMS GC is the default. Swift export is Alpha, and Flow is exported as
AsyncSequence. - Compose compiler flags:
StrongSkippingandIntrinsicRememberareDeprecationLevel.ERROR(removed in 2.5.0).OptimizeNonSkippingGroupsandPausableCompositionare deprecated (removed in 2.6.0). Remove them fromcomposeCompiler {}blocks. -Xpartial-linkageis deprecated because partial linkage is always on. The Ant build is no longer supported.- Wasm incremental compilation is stable and on by default.
What to do now
- Set the Kotlin Gradle plugin to 2.4.20, with AGP >= 8.5.2 and Gradle <= 9.5.0.
- Replace private
_backingproperty pairs with explicit backing fields where it simplifies code. - Remove deprecated Compose compiler feature flags.
- On AGP 9, drop
org.jetbrains.kotlin.androidin favor of built-in Kotlin. - Raise Apple deployment targets for KMP.