Repository navigation
Migrate Android plugin to built-in Kotlin (#94) - #98
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Bumping the SDK constraint to ^3.12.0 raises the language version, so 'dart format' (tall style) now reformats 66 files. Required for the CI 'Verify formatting' step.
felnanuke2
reviewed
Oct 7, 2026
felnanuke2
left a comment
Owner
There was a problem hiding this comment.
Review — Migrate Android plugin to built-in Kotlin (#94)
Verdict: changes look correct. ✅ Matches the official plugin-author migration guide point by point:
- Removes the KGP classpath +
kotlin-androidapply +kotlin-stdlib-jdk7dependency — correct. kotlinOptions→kotlin { compilerOptions { jvmTarget = JVM_11 } }using the type-safe DSL — correct replacement.- SDK floors (
dart: ^3.12.0,flutter: >=3.44.0) match the minimums the migration requires, and the CHANGELOG documents it.
Verified locally (Flutter 3.44.2 stable, same as CI): flutter analyze clean, 306/306 tests pass.
CI failure fixed 🔧
The test job was failing on "Verify formatting": bumping the SDK constraint raises the language version to 3.12, which switches dart format to the tall style — 66 files needed reformatting. I pushed 5f8c5d7 applying exactly that reformat (no logic changes; all files still analyze clean and tests pass).
Non-blocking suggestions
android/build.gradlestill hassourceSets { main.java.srcDirs += 'src/main/kotlin' }— redundant with built-in Kotlin (already includessrc/main/kotlin); can be dropped.- The example app itself still applies KGP (
kotlin-android,kotlinOptions,kotlin-stdlib-jdk7). Allowed for host apps today, but worth migrating eventually to stay ahead of the same deprecation. - Raising the minimum SDK is a breaking change for consumers — consider releasing this as 2.0.0 rather than a 1.x patch/minor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #94, following the plugin-author migration guide.
android/build.gradle: no longer applieskotlin-androidor putskotlin-gradle-pluginon the buildscript classpath;kotlinOptionsbecomeskotlin { compilerOptions { jvmTarget } }; thekotlin-stdlib-jdk7dependency is dropped.pubspec.yaml: minimum Flutter 3.44 / Dart 3.12, as the guide requires.CHANGELOG.md: entry added.Tested
A Flutter 3.47.4 app on AGP 9.0.1 with
android.builtInKotlin=true, using this branch as a path dependency:flutter build apk --debugsucceeds, prints no KGP warning, andGoogleCastPluginis in the APK's dex.Not tested
android.builtInKotlin=falsethis plugin's Kotlin sources are no longer compiled (the build then fails onGoogleCastPluginnot found), so apps need built-in Kotlin enabled, as the guide describes.