RIP-Comm / sossoldi

"Sossoldi" is a wealth management / personal finance / Net Worth tracking app, made with Flutter.
MIT License
276 stars 75 forks source link

Update Flutter Gradle plugin configuration #171

Open gioisco opened 2 months ago

gioisco commented 2 months ago

Summary

This pull request addresses deprecation warnings related to the use of Flutter's Gradle plugins. Specifically, it updates the Gradle configuration files to replace the imperative apply script method with the declarative plugins block.

Issue

When running flutter run, the following deprecation warnings were encountered:

Launching lib/main.dart on CPH2211 in debug mode...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

References

According with the Flutter documentation this PR apply the new plugin configuration method.

Changes Made

The following changes have been made to address the deprecation warnings:

  1. Updated android/app/build.gradle:

    • Replaced apply plugin: statements with the plugins { id: } block.
    • Removed the obsolete apply from statement.
  2. Updated android/build.gradle:

    • Removed the outdated buildscript block and migrated to the new plugin management system.
  3. Updated android/settings.gradle:

    • Added pluginManagement block to specify plugin versions and repositories.
    • Used the plugins block for plugin configuration instead of apply from.

These changes align with the latest Flutter Gradle plugin requirements and ensure compatibility with future releases.

Testing

The updates have been tested with the flutter run command to verify that the deprecation warnings are resolved and the application builds successfully.

Please review and merge this PR to ensure compatibility with the latest Flutter Gradle plugin standards.

mikev-cw commented 1 month ago

Looks good to me, it just works as expected! 👍🏻