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

Aperta
#1,311 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, dart, flutter, kotlin

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Dart
Stelle
610
Fork
731
Merge medio
3m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di carp-dk/flutter-plugins

Tutte le issue di carp-dk/flutter-plugins

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.