fix(android): complete Built-in Kotlin migration (kotlinOptions → kotlin.compilerOptions) - #1096
Merged
Merged
Conversation
Lyokone
force-pushed
the
fix/android-builtin-kotlin-compileroptions
branch
from
July 22, 2026 14:30
68404eb to
92cd45c
Compare
Lyokone
added a commit
that referenced
this pull request
Jul 22, 2026
The Android e2e job is the only *blocking* job in the e2e workflow (iOS, Web, macOS and Windows are all already continue-on-error). It was the sole reason the whole e2e run went red on #1096: Patrol's native UIAutomator grantPermissionWhenInUse() intermittently returns "Invalid response: 404 -- selector button to allow permission while using found nothing" when the Android system permission dialog hasn't finished rendering the instant Patrol polls for it. This is timing flake, not a regression: the identical test path passed on #1094 and failed on #1096 with no change to it. Wrap each `patrol test` invocation in an inline retry (up to 3 attempts, 5s apart). A genuine failure still exits non-zero after the retries, so real breakage stays red.
The KGP `apply` was already gated behind AGP < 9 (c41aca5), but the `android.kotlinOptions {}` block remained. That block is provided by the kotlin-android plugin and is not available under AGP 9's Built-in Kotlin, so the migration was incomplete and would fail to configure on AGP 9. Move the jvmTarget configuration to the top-level `kotlin { compilerOptions {} }` DSL, which resolves both with KGP (AGP < 9) and with Built-in Kotlin (AGP 9), completing the migration. Fixes #1095
Lyokone
force-pushed
the
fix/android-builtin-kotlin-compileroptions
branch
from
July 22, 2026 14:52
92cd45c to
dcbe9cb
Compare
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.
Summary
Fixes #1095.
v10.0.0 already made the
kotlin-android(KGP)applyconditional on AGP < 9 (c41aca5), so the plugin no longer applies KGP under AGP 9's Built-in Kotlin. However the migration was incomplete: theandroid { kotlinOptions {} }block remained. That block is contributed by thekotlin-androidplugin and is not available under AGP 9's Built-in Kotlin, so the plugin would fail to configure on AGP 9.This PR moves the
jvmTargetconfiguration to the top-levelkotlin { compilerOptions {} }DSL, which resolves both with KGP (AGP < 9) and with Built-in Kotlin (AGP 9), per Flutter's plugin-author migration guide.Changes
android/build.gradle: replaceandroid.kotlinOptions { jvmTarget = "11" }with top-levelkotlin { compilerOptions { jvmTarget = JvmTarget.JVM_11 } }.10.0.1+ CHANGELOG entry.Notes
kotlin {}extension is available in both configurations: with KGP applied (AGP 8) and with Built-in Kotlin (AGP 9), so this is safe across the AGP range the plugin supports. Uses KGP 2.2.20 already declared in the buildscript.