i can't run my project and everytime i tried i receive a message telling me that
my project's Gradle version is incompatible with the Java version that Flutter is using for Gradle
i tried to change my gradle version to one compativble with the java version that my flutter project is using but it didn't work.
Based on the command line :
flutter doctor --verbose
My java version is :
Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
i use android studio

You should start with updating your gradle. As per compatibility matrix your project should use at least 8.5 version.
To update, there are several options:
./gradlew wrapper --gradle-version 8.5 or gradlew.bat wrapper --gradle-version 8.5 (windows) in project's android directorydistributionUrl in gradle.properties (on the screenshot in the question) to distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zipAfter that make sure that version of AGP (com.android.application) is at least 8.3.2. But newer is better I guess.
After that build should work again.
Try deleting android folder to remove outdated configurations or incorrect settings then run
flutter create .
this will create new android folder with default settings based on your installed Flutter version. Then try running project
flutter run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With