Skip to content

Migrate plugin to Built-in Kotlin (AGP 9 / Flutter 3.44+) #20

Description

@emanuelesenis

Hello,

Flutter is migrating Android plugins away from explicitly applying the Kotlin Gradle Plugin (KGP) toward AGP’s built-in Kotlin support.

Starting with Android Gradle Plugin (AGP) 9.0, applying org.jetbrains.kotlin.android / kotlin-android in a plugin’s android/build.gradle conflicts with built-in Kotlin and will break builds once apps opt in.

Flutter 3.44+ already warns when a plugin still applies KGP:

WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): open_mail
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.
Please migrate open_mail to built-in Kotlin so your users can move to AGP 9+ without workarounds.

How to migrate

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

App developer context / reporting guide:
https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers#report-incompatible-kotlin-gradle-plugin-usage-to-plugin-authors

Related Flutter tracking:
flutter/flutter#181383

Environment (example)

  • Package: open_mail ^1.2.1
  • Flutter: 3.44.x (stable)
  • Warning appears on flutter build apk / flutter run

If you have questions, the Flutter team suggests #hackers-android on Flutter’s Discord or a flutter/flutter issue.
Thank you for maintaining open_mail and for your contributions to the Flutter ecosystem!

Why this matters

  • AGP 9 enables built-in Kotlin by default; duplicate KGP application causes failures.
  • Flutter’s temporary KGP compatibility is not permanent.
  • Many apps are auditing dependencies before enabling android.builtInKotlin=true and dropping android.builtInKotlin=false from gradle.properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions