flutter_gradle_plugin_migration_script 0.0.1
flutter_gradle_plugin_migration_script: ^0.0.1 copied to clipboard
Support migrate your app to new Plugin DSL syntax
Flutter Gradle Plugin Migration Script #
A small Dart utility that migrates Android Gradle files in Flutter apps to the new Gradle plugin application mechanism introduced by Flutter’s breaking change “flutter-gradle-plugin-apply”.
- Follows the official guidance: https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply
- Scans recursively for
android/folders and updates only the three top-level Gradle scripts:android/settings.gradleandroid/build.gradleandroid/app/build.gradle
What it does #
- Moves plugin classpaths from
buildscript {}into the modernplugins {}syntax insettings.gradle/app/build.gradle. - Cleans obsolete lines (e.g., legacy Flutter loader apply lines).
- Keeps repositories (
google(),mavenCentral(),gradlePluginPortal()) in place. - Handles special cases:
- Plugins that require resolution strategy in
settings.gradle. - Huawei AG Connect plugin requiring
buildscriptwith AGP dependency.
- Plugins that require resolution strategy in
- Skips:
- Android modules already migrated (e.g.,
pluginManagement {}present). - Modules without
app/build.gradle.
- Android modules already migrated (e.g.,