Exception in phase 'semantic analysis'

Hi! I am getting this error when trying to run a Flutter application on my Smartphone using VSCode. I used to run this project last year (around Nov) with no issues but I upgraded Flutter to most recent version and I´m getting this or other issues and cannot find a way to solve this matter.

FAILURE: Build failed with an exception.

* Where:

Settings file 'C:\Users\sophi\OneDrive\Escritorio\Universidad\Proyecto\DesarrolloApp\guatecomercio\proyecto_1\android\settings.gradle' line: 11

* What went wrong:

A problem occurred evaluating settings 'android'.

> Could not open dsl generic class cache for script 'C:\Users\sophi\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' (C:\Users\sophi\.gradle\caches\7.5\scripts\1s1hcd0f2ybk8l9zid9qpsq18).

> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

* 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 1s

The error tells you that you try to run a Gradle 7.5 build using Java 21 which is not supported: Compatibility Matrix