I tired to release a flutter application using those command of course :
flutter clean flutter pub get flutter build apk --release
and this error occurred:
`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/to/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/to/flutter-gradle-plugin-apply
FAILURE: Build failed with an exception.
-
Where:
Script ‘/Users/badriyahaddad/flutter_path/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy’ line: 343 -
What went wrong:
A problem occurred evaluating script.
Failed to apply plugin class ‘FlutterPlugin’.
Could not get unknown property ‘usesUnsupportedDependencyVersions’ for project ‘:app’ of type org.gradle.api.Project.
- Try:
Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 1m 36s
Running Gradle task ‘assembleRelease’… 96.8s
Gradle task assembleRelease failed with exit code 1`
- So I have tried to clear the gradle cashes but did work
- I tried to upgrade the gradle file like :
distributionUrl=https://services.gradle.org/distributions ...
, orclasspath 'com.android.tools.build:gradle:...
but also did not work - I tried to upgrade flutter but that’s no luck either
- I did ask chatGPT 4 but it did help me
in your opinion what should I do ?