Skip to content

Plugin applies Kotlin Gradle Plugin unconditionally — blocks Flutter's Built-in Kotlin migration #76

Closed

Description

@kostyaten

native_workmanager (1.8.1, latest) applies the Kotlin Gradle Plugin
unconditionally in its android/build.gradle, which makes it a blocker for
Flutter's upcoming Built-in Kotlin migration. On current Flutter this
already surfaces as a build-time warning, and per the Flutter team future
Flutter versions will fail to build
for any app depending on a plugin that
applies KGP.

Flutter warning

WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP):
... native_workmanager ...
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.
Please check the changelogs of these plugins and upgrade to a version that
supports Built-in Kotlin.

Guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

Activity

  1. vietnguyentuan2019 commented on Sep 23, 2026

    @vietnguyentuan2019
    Contributor

    hey @kostyaten thanks for flagging this, good catch 🙏

    turned out it was a bit worse than the warning. with android.builtInKotlin=true, 1.8.1 doesnt just warn, the build straight up fails with Failed to apply plugin 'kotlin-android'.

    fixed in 1.8.2 (just published): the plugin doesnt apply KGP at all anymore (kotlinOptions → kotlin { compilerOptions { jvmTarget = JVM_17 } }). i checked the compiled plugin classes come out identical on 3.47.5 with builtInKotlin on and off, on AGP 8 apps with KGP in the root, and on 3.44.0. also did a fresh flutter create on 3.47.5 with builtInKotlin=true pulling 1.8.2 from pub.dev and it builds clean, no warning.

    one heads up: min Flutter is now 3.44. thats the first version where flutter itself applies KGP to plugins when built-in kotlin is off, so below that the kotlin sources wouldnt compile. if your on older flutter pub will just keep you on 1.8.x.

    theres also a small test now that runs flutters own detection regex over our build.gradle so this cant sneak back in. closing, but ping me if you still see the warning after upgrading. PRs: #77, release #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions