尝试构建 apk 时出现错误:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\Ruble\flutter_project\android\settings.gradle'
(C:\Users\Ruble\.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
Run Code Online (Sandbox Code Playgroud)
使用 flutter 构建的命令看起来像这样 - flutter build apk。
此错误可能发生在 Android Studio、Visual Studio Code 和其他可以构建 Android 应用程序的工具中。
另外,无论是 React Native 还是 Flutter。
如何修复它?