I am using flutter for the first time, after running main.dart I am getting the following error. Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\nayye\AndroidStudioProjects\ridewave_b\android\app\build.gradle' line: 24
What went wrong: A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'. Could not create plugin of type 'AppPlugin'. > Could not generate a decorated class for type AppPlugin. > com/android/build/api/component/Component
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.
BUILD FAILED in 7s Exception: Gradle task assembleDebug failed with exit code 1
I ran flutter doctor -v and there isnt any problem with android studio.
I faced simliar situation you met,
In Light of my experience, Removing gradle file and rebuilding Projects initially is a best solution about gradle setting problems.