I have an issue after I upgraded my Flutter version to the latest version, on where it tells me that something wrong with my Gradle. I've checked all over Stack Overflow, and I also join the flutterdev on Discord, I tried one of the potential solutions like, reinstall my SDK tools, flutter clean, but none of them worked for me.
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\PROJECT\flutter-project\dice_practice\android\app\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt
* 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 7s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I have downgraded my Flutter before, to the stable version of 3.3.0, but still with the same issue. Even I have tried almost all of the sdk-builds version. However, when I encountered this, I read somewhere on the community said that, probably I need to upgrade my Gradle.
As I upgraded it with Android Studio, it somehow worked, but the issue is, why do I need to upgrade for each project manually, isn't a way to upgrade globally? And is it my Gradle issue? Why this does happen so weirdly after I upgraded my Flutter? Do you guys also encounter the same issue?
Add: this also happens each time I create a new project.