workmanager_android: guarded apply plugin: 'kotlin-android' is the pattern Flutter says will stop building (flutter/flutter#189770)
Nadie ha tomado este issue todavía.
- #744 de @kuhyx — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- build-system, mobile
Línea de trabajo
Start with workmanager_android's android/build.gradle and compare its guarded Kotlin plugin application with FlutterPluginUtils behavior for the supported Flutter versions. Remove the obsolete guarded pattern if compatibility checks support it, retain the existing compilerOptions block, and run the issue's Flutter 3.47.5 Android build reproduction to confirm the warning is gone.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
| Technology | Version |
|---|---|
| workmanager | 0.10.10 |
| workmanager_android | 0.10.9 |
| Flutter | 3.47.5 (6a19cca564) |
| Android Gradle Plugin | 9.4.1 |
| Gradle | 9.7.1 |
Describe the error
With android.builtInKotlin=true in the app's gradle.properties, every Android build prints:
WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): workmanager_android
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.
At runtime the plugin does not apply KGP: the guard added in #721 / #722 skips it. I checked with an init script over every project, and plugins.hasPlugin('org.jetbrains.kotlin.android') is false for workmanager_android. The warning comes from Flutter's detectApplyingKotlinGradlePlugin, which regex-matches the guarded apply plugin: 'kotlin-android' line in android/build.gradle.
This isn't a Flutter bug they plan to fix. They closed flutter/flutter#189770 on 2026-10-02 as intended behaviour. They now discourage the guarded pattern, removed it from their docs, and say it will fail to build once their regex is fixed (closing comment). The guidance there is to follow the direct migration for plugin authors.
The case the guard exists for (an app that keeps android.builtInKotlin=false, Flutter's default) appears to be handled by Flutter itself now. On 3.47.5, FlutterPluginUtils.detectApplyingKotlinGradlePlugin applies kotlin-android to any plugin subproject that doesn't apply it when built-in Kotlin is off (source). So dropping the guard and the apply plugin: 'kotlin-android' line entirely, and keeping the kotlin { compilerOptions { ... } } block, may cover both cases. I haven't checked which minimum Flutter version you support, or whether older versions have that fallback.
Repro
- A Flutter 3.47.5 app on AGP 9.x depending on
workmanager: ^0.10.10. - Set
android.builtInKotlin=trueinandroid/gradle.properties. flutter build apk --debug. The warning above listsworkmanager_android.
- Lenguaje dominante
- Dart
- Estrellas
- 1k
- Forks
- 361
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fluttercommunity/flutter_workmanager
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
fluttercommunity/flutter_workmanager#742 · 3 comentarios ·
-
feat: WorkmanagerDebug handlers on web, linux and windows (same API as Android/iOS)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Todos los issues de fluttercommunity/flutter_workmanager
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
OscillateLabsLLC/ovos-gui-visage#52 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Docs not reachableAbiertobug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
fluttercommunity/plus_plugins#4018 ·
-
docs: add per-harness setup docsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
VeryGoodOpenSource/vgv_ai_cli#150 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
PATILYASHH/XPENC#206 · 1 comentario ·