Skip to content

fix: AGP 9's built-in Kotlin; release skill - #21

Merged
lemcoder merged 3 commits into
mainfrom
fix/jni-without-kotlin
Nov 9, 2026
Merged

lemcoder merged 3 commits into
mainfrom
fix/jni-without-kotlin

Conversation

@lemcoder

@lemcoder lemcoder commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • kotlinNativeDistribution() in built-in Kotlin modules. AGP 9 compiles Kotlin without applying org.jetbrains.kotlin.android; it only registers the kotlin extension. The plugin detected Kotlin by plugin id, so an Android-only module got the plugin's default version (2.4.20) instead of its own (2.2.10 with AGP 9.2.1). The version is now read from the kotlin extension, lazily, so the order of plugins { } no longer matters. GradlePluginId.KOTLIN_ANDROID is gone.
  • JNI bindings in a module that compiles no Kotlin. With android { enableKotlin = false }, AGP keeps variant.sources.kotlin but registers no compile<Variant>Kotlin, so generated JNI bindings were silently never compiled. Configuring pre<Variant>Build now fails with: JNI bindings are Kotlin, and variant 'debug' compiles none (android { enableKotlin = false }?). Enable Kotlin, or call ffm() in the binding for Java bindings.
  • Release skill (.claude/skills/release/SKILL.md): bump and changelog, publishPlugins, a Portal-only check, then tag and GitHub release.

Tests

  • New: kotlinNativeDistribution() names AGP's KGP version in both plugin orders. It fails on the old code (…-2.4.20).
  • New: enableKotlin = false with a JNI binding fails configuration with the message; with Kotlin on, the same module configures.
  • Local: 69 passed / 2 skipped; Kotlin 2.0 suite (-PtestGradleVersion=8.7 -PkgpTestVersion=2.0.0) 64 / 7 skipped, where the AGP 9 tests skip. examples/android and examples/kmp configure (--dry-run).

🤖 Generated with Claude Code

lemcoder and others added 3 commits November 9, 2026 11:41
The steps that publish a version: bump and changelog, publishPlugins, a
Portal-only check, tag and GitHub release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kotlinNativeDistribution() took the Kotlin version only when a Kotlin
plugin id was applied. Built-in Kotlin applies none, only the kotlin
extension, so an Android module got the plugin's default version
(2.4.20) instead of its own (AGP 9.2.1's 2.2.10). The version now comes
from the extension, asked lazily so plugin order does not matter.

JNI bindings are Kotlin. In a module with android { enableKotlin = false }
AGP keeps the Kotlin source directory but registers no Kotlin compile, so
the bindings were never compiled and Java callers could not find them.
Configuring such a variant's build now fails, naming enableKotlin and
ffm() as the ways out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux x64's distribution is kotlin-native-prebuilt-linux-x86_64-…

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lemcoder
lemcoder merged commit 948cfbd into main Nov 9, 2026
1 check passed
@lemcoder
lemcoder deleted the fix/jni-without-kotlin branch November 9, 2026 10:54
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.

1 participant