Gradle cache issue

Solution for Gradle cache issue
is Given Below:

I am a beginner in flutter application development. And when I Run my flutter default project code on emulator, I face this issue:

Launching libmain.dart on AOSP on IA Emulator in debug mode…
Running Gradle task ‘assembleDebug’…

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not open settings generic class cache for settings file ‘C:UsersAdministratorStudioProjectsmyappandroidsettings.gradle’ (C:UsersAdministrator.gradlecaches6.7scripts1fnwrr8g4rohfp291nvlxj5qe).

BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript‘ Unsupported class file major version 60

Make sure you have the JAVA_HOME in your environment variables.

Example for path:

C:Program FilesJavajdk-16.0.2

And check that the flutter doctor is running successfully:

flutter doctor

a guide to setting the JAVA_HOME variable in Windows