alibaba / alibaba/flutter_boost
[Feature Request] Support Gradle 9.x / AGP 9.x compatibility
- Dominant language
- Dart
- Stars
- 7.2k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- **flutter_boost version**: 5.0.2
- **Flutter version**: 3.35.0+ (Kotlin-based Gradle plugin)
- **Gradle version**: 9.2.0
- **AGP version**: 8.10.1 / 9.0.0
- **OS**: macOS
## Description
When using Gradle 9.x (which bundles Groovy 4 and Kotlin 2.2), the project fails to configure the `:flutter_boost` module with a `NullPointerException`:
A problem occurred configuring project ':flutter_boost'.
> Failed to notify project evaluation listener.
> java.lang.NullPointerException (no error message)
at com.flutter.gradle.FlutterPluginUtils.getAndroidExtension$gradle(FlutterPluginUtils.kt:391)
at com.flutter.gradle.FlutterPluginUtils.getCompileSdkFromProject(FlutterPluginUtils.kt:405)
at com.flutter.gradle.plugins.PluginHandler$Companion$configurePluginProject$2.execute(PluginHandler.kt:143)
## Root Cause
Flutter 3.32+ converted the Gradle plugin from Groovy to Kotlin. The new `PluginHandler` tries to call `getAndroidExtension()` on the `flutter_boost` plugin project during `afterEvaluate`, but the Android extension is null at that point — likely because `flutter_boost`'s `build.gradle` does not apply the Android library plugin in a way that is compatible with the new Flutter Kotlin Gradle plugin's evaluation order.
## Expected Behavior
`flutter_boost` should be compatible with:
- Gradle 9.x (Groovy 4, Kotlin 2.2)
- Flutter 3.32+ (Kotlin-based Gradle plugin)
- AGP 9.x (new DSL)
## Workaround
Currently the only workaround is to downgrade to:
- Flutter ≤ 3.29.x (Groovy-based Gradle plugin)
- Gradle 8.x (Groovy 3)
## Related
- Flutter AGP 9 migration guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-agp-9
- Flutter Gradle 9 module issues: https://github.com/flutter/flutter/issues/181520
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the configuration failure with flutter_boost 5.0.2 under Flutter 3.35.0+, Gradle 9.2.0, and AGP 8.10.1 or 9.0.0. Inspect the plugin project's build.gradle alongside FlutterPluginUtils.kt and PluginHandler.kt, then verify that the module configures successfully across the listed tool versions without the NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart
- Domain
- build-system, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100