'After upgrading flutter unable to build app ould not open settings generic class cache for settings file

After ive upgrade my flutter version from 2.5.x to 2.10.3 I am unable to build my app.

Error is:

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings remapped class cache for 3gvp67rxesfd2nfkbvtuzjg3o (C:\Users\User\.gradle\caches\6.3\scripts-remapped\settings_8xyk3a2se7ntfxhbq76drbyq8\3gvp67rxesfd2nfkbvtuzjg3o\settingsdeec0faa97453e2ce860d75e6bf1604b).
> Could not open settings generic class cache for settings file 'D:\dev\projects\project\app\android\settings.gradle' (C:\Users\User\.gradle\caches\6.3\scripts\3gvp67rxesfd2nfkbvtuzjg3o\settings\settingsdeec0faa97453e2ce860d75e6bf1604b).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61

* 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 2s
Exception: Gradle task assembleDevDebug failed with exit code 1

Event after downgrading back to original version the same error is shown. Ive tried deleting the gradle cache but it has no effect.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source