Feature: Upgrade to plugins DSL syntax of gradle
Description
The project doesnot build with Flutter version 3.29.0 (channel stable) due to the error:
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is not possible anymore. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply
Upgrading the gradle syntax will make it support updated versions of flutter.
Already resolved this in CCExtractor/taskwarrior-flutter repo.
Screenshots
The issue has been resolved by adjusting the environment settings. No code modifications were needed.
If you encounter the following error while building your Flutter project:
FAILURE: Build failed with an exception. ...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is not possible anymore. Migrate to applying Gradle plugins with the declarative plugins block.
Follow these steps to resolve the issue:
- Downgrade Flutter to version 3.22.2:
- Uninstall Android Studio completely from your system.
- Install Koala 2024.1.2.8 as a replacement for Android Studio.
- Ensure you are using Java 17: If you have any other Java versions installed (higher or lower), uninstall them. Download and install Java 17 Set Java 17 as the default version by configuring the environment variables
- Restart your computer after installation.
- Navigate to your Flutter project directory and run:
flutter pub get
flutter run
Important Note: 🔴 Do not upgrade the dependencies after running flutter pub get, as it may cause compatibility issues.
Now Please Close this issue!!
Hello @Ni1esh-Yadav I know downgrading the entire environment would run the project. That is why I have raised the issue to make it compatible with the current stable version of flutter. Downgrading the entire environment is not the solution but the problem. It also makes contributing to the project inconvenient as one needs to downgrade his entire setup to make it run. Now if the repo maintainers think that is not required, they can close this issue. Thank you.
@Mastermind-sap You can raise a PR for this. But updating to the later versions of flutter has a bit more dependency with third party packages. So, this alone will not enable us to migrate to latest version of Flutter.
@MarkisDev Ok I will start working on it.
@MarkisDev I have fixed and raised a PR.