[health 13.3.2] Migrate Android build to Built-in Kotlin (plugin applies KGP)

Open
#1,311 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
android, dart, flutter, kotlin

Research direction

Read the Flutter plugin-author guide linked in the issue and inspect packages/health/android/build.gradle. Compare the migration approach with the in-progress changes in issues #1297 and #1310. Update the Android build to use Built-in Kotlin, then verify the plugin builds without applying KGP; the issue describes the current warning and affected Flutter setting.

Written by the indexing model from the issue text.

Description

Description

Please migrate the Android build of health (13.3.2) to Built-in Kotlin, as described in the Flutter guide for plugin authors: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

On Flutter 3.47.9 (stable), every Android build of an app that depends on health prints:

Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): health. Future versions of Flutter will fail to build if your app uses plugins that apply KGP.

Today this is only a warning. Flutter has said that apps using plugins which apply KGP will fail to build in a future release. Because of that, apps that depend on health can't move to android.builtInKotlin=true, and they will eventually be stuck on an older Flutter version.

packages/health/android/build.gradle currently:

  • declares org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22 in buildscript
  • applies kotlin-android unconditionally
  • configures the compiler through android { kotlinOptions { ... } }
Additional information
  • Wrapping apply plugin: 'kotlin-android' in a check of android.builtInKotlin is not a durable fix. In flutter/flutter#189770, the Flutter team said they discourage that pattern and that it will stop building once the KGP detection is tightened. The direct migration in the plugin-author guide is the supported path.
  • The same migration is already in progress for other plugins in this repo (#1297, #1310), so the health change could follow the same approach.
  • #1300 removed a KGP warning that came from device_info_plus. This request is about the warning caused by health's own build file.

Thanks for maintaining the plugin.

Dominant language
Dart
Stars
610
Forks
731
Avg merge
3m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from carp-dk/flutter-plugins

All issues in carp-dk/flutter-plugins

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.