Skip to content

Migrate off legacy Kotlin Gradle Plugin apply per the built-in-Kotlin migration (#636)#643

Open
aki1770-del wants to merge 1 commit into
dlutton:masterfrom
aki1770-del:fix/kotlin-gradle-plugin-migration
Open

Migrate off legacy Kotlin Gradle Plugin apply per the built-in-Kotlin migration (#636)#643
aki1770-del wants to merge 1 commit into
dlutton:masterfrom
aki1770-del:fix/kotlin-gradle-plugin-migration

Conversation

@aki1770-del

Copy link
Copy Markdown

Addresses #636. Applies the official plugin-author migration (docs.flutter.dev → "Migrate to built-in Kotlin" → plugin authors), using the documented variant for plugins that support Flutter versions earlier than 3.44: KGP is applied conditionally only while AGP < 9, and android.kotlinOptions moves to the kotlin { compilerOptions { jvmTarget = ... } } DSL. The buildscript Kotlin classpath is retained because the conditional branch can still apply KGP on older toolchains (kotlin_version 2.2.20 satisfies the compilerOptions DSL floor).

Verification (build-verified locally before submitting): flutter build apk --debug on the example is green on a current pre-release SDK (post-deprecation Gradle semantics, so the new DSL is exercised at configure time) and on Flutter 3.38.3 (older-consumer back-compat).

Note: I couldn't capture the warning-disappears transition the 3.44 reporters see — the SDKs I have locally don't emit the KGP deprecation warning even on unmigrated master. This change follows the official migration doc for plugins supporting pre-3.44 Flutter, and the example builds green on both a current pre-release SDK and 3.38.3. Happy to adjust if CI on a newer stable shows anything different.

…lutton#636)

Flutter 3.44+ deprecates plugins that apply KGP themselves, and AGP 9
removes support for it (built-in Kotlin). Per the official plugin-author
migration guide
(https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors),
apply kotlin-android only when the consuming app's AGP major version is
below 9, and replace the android.kotlinOptions block with the
kotlin.compilerOptions DSL (requires KGP >= 2.0, already satisfied by
kotlin_version 2.2.20). The conditional keeps the plugin buildable for
apps on older stable Flutter/AGP versions.
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