Skip to content

chore(android): migrate app to Built-in Kotlin (drop standalone Kotlin Gradle Plugin) #658

Description

@Zeroupper

Problem

The Android app still applies the standalone Kotlin Gradle Plugin (KGP), which Flutter is deprecating. Building logs:

WARNING: Your Android app project applies the Kotlin Gradle Plugin, which will cause build failures in future versions of Flutter. Please migrate your app to Built-in Kotlin.

android/app/build.gradle still has:

  • id "kotlin-android" (line 3)
  • a kotlinOptions { ... } block (line 40)
  • main.java.srcDirs += 'src/main/kotlin' (line 45)

Migration guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers

Current versions (post-#598 — already upgraded)

  • AGP 9.0.1, Gradle 9.1.0, Kotlin 2.2.20, Flutter 3.44.6
  • So this is not a version bump — it's the plugin-application migration only.

Also flagged: plugins that apply KGP

Flutter warns these dependencies apply KGP and could block future builds until each ships a Built-in-Kotlin-compatible release:

audio_streamer, camera_android_camerax, device_info_plus, flutter_activity_recognition, flutter_background, flutter_timezone, flutter_web_auth_2, health, light, location, network_info_plus, oidc_android, open_settings_plus, package_info_plus, pedometer, polar

We can only migrate the app project ourselves; for the plugin warnings we depend on upstream releases — track and bump as compatible versions land, and report/patch any that lag.

Acceptance criteria

  • android/app/build.gradle migrated to Built-in Kotlin per the guide (no standalone kotlin-android apply)
  • App builds on Android in release mode with no KGP deprecation warning for the app project
  • Audit the listed plugins; bump those with Built-in-Kotlin-compatible releases, note the blockers for the rest

Related

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions