Skip to content

build: support Kotlin 2.2 on JVM and Android (#364) - #366

Merged
devcrocod merged 1 commit into
developfrom
build/364-kotlin-2.2-compat
Nov 10, 2026
Merged

devcrocod merged 1 commit into
developfrom
build/364-kotlin-2.2-compat

Conversation

@devcrocod

@devcrocod devcrocod commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #364.

Multik stays on the latest Kotlin, but languageVersion, apiVersion and the kotlin-stdlib dependency are now 2.2, so JVM and Android projects on Kotlin 2.2+ can use it. JS, WasmJS and Native still need Kotlin 2.4: a project can't use klibs built with a newer Kotlin.

JS and Wasm keep the compiler's stdlib and kotlin-test, because their compilers reject older ones.

The API dump loses 12 synthetic bridges that came with Kotlin 2.4 (#336), so MutableMultiArray and MemoryView match 0.3.1 again.

Testing

  • Tests pass on JVM, macosArm64 and iosSimulatorArm64; apiCheck korroCheck pass.
  • Test projects on Kotlin 2.2.21 (JVM, Android) build and pass. Against develop, the JVM one fails on metadata 2.4.0.
  • A Kotlin 2.4.21 project passes on JVM, macosArm64, JS and Wasm.

Checklist

  • Existing tests pass
  • New/updated tests for changed behavior
  • New/updated documentation if necessary

Multik keeps building with the latest Kotlin (2.4.21), but projects on
Kotlin 2.2 or newer can now use its JVM and Android artifacts:

- languageVersion and apiVersion are 2.2, so classes carry 2.2.0 metadata
  and can't use newer language features or stdlib API.
- coreLibrariesVersion is 2.2.0, so the published variants depend on
  kotlin-stdlib 2.2.0 instead of pulling 2.4.21 into the project.
- JS and Wasm keep the stdlib and kotlin-test of the compiler, the only
  ones their compilers accept. They go to jsMain and wasmJsMain, not
  webMain: dependencies of shared source sets end up in the metadata
  variant, which multiplatform projects on Kotlin 2.2 resolve too.

JS, WasmJS and Native still need Kotlin 2.4. Their klibs carry ABI
version 2.4.0, which older compilers reject, and Kotlin 2.4 can export
klibs only to 2.3 and only as pre-release binaries.

Language version 2.2 also turns off JvmEnhancedBridges (since 2.4), so
the API dump loses 12 synthetic bridges in MutableMultiArray and
MemoryView. They came with the Kotlin 2.4 bump (#336), after 0.3.1;
both classes now match the 0.3.1 dump.
Copilot AI balanced review requested due to automatic review settings November 10, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Kotlin 2.2 JVM and Android compatibility changes.

No open issues 🎉

What changed in this PR

Enables Kotlin 2.2 projects to consume Multik’s JVM and Android artifacts while retaining the Kotlin 2.4 build toolchain, addressing #364. JS, WasmJS, and Native still require Kotlin 2.4 or newer.

Changes:

  • Sets language/API compatibility and the default standard-library dependency to Kotlin 2.2.
  • Keeps web dependencies aligned with the compiler and updates the JVM API dump to reflect removed, unreleased synthetic bridges.
  • Documents platform-specific Kotlin requirements.
File Description
README.md Adds Kotlin version requirements by platform.
multik-core/​api/​jvm/​multik-core.api Removes 12 synthetic bridges disabled by language version 2.2.
docs/​topics/​gettingStarted/​installation.md Adds compatibility requirements and links to the FAQ.
docs/​topics/​FAQ.md Explains platform requirements and older-compiler failures.
buildSrc/​src/​main/​kotlin/​multik.base.gradle.kts Sets Kotlin 2.2 language/API versions and standard-library baseline.
buildSrc/​src/​main/​kotlin/​multik.all-targets-kmp.gradle.kts Aligns JS/Wasm standard libraries and web test dependencies with the compiler.

Review effort: Balanced

@devcrocod
devcrocod merged commit 61f9cf5 into develop Nov 10, 2026
3 checks passed
@devcrocod
devcrocod deleted the build/364-kotlin-2.2-compat branch November 10, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep Kotlin Version 1-2 Minor Versions Behind Latest

2 participants