j**a version "21.0.7" 2025-04-15 LTSJ**a(TM) SE Runtime Environment (build 21.0.7+8-LTS-245)J**a HotSpot(TM) 64-Bit Server VM (build 21.0.7+8-LTS-245, mixed mode, sharing)Doctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, 3.29.3, on Microsoft Windows [版本 10.0.19041.264], locale zh-CN)[√] Windows Version (10 专业版 64 位, 2004)[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1)[√] Chrome - develop for the web[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)[√] Android Studio (version 2024.3)[√] VS Code (version 1.99.3)[√] Connected device (3 **ailable)[√] Network resources
执行完命令:flutter build apk报错如下:FAILURE: Build failed with an exception.What went wrong:Could not open cp_settings generic class cache for settings file 'C:\jk-katalon\workspace\XXXX\XXXX-app\android\settings.gradle' (C:\Users\cs.gradle\caches\8.0\scripts\8ju52g7d2hqvl85b219kdzjzv).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.orgBUILD FAILED in 8sRunning Gradle task 'assembleRelease'... 9.3s
┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐│ [!] Your project's Gradle version is incompatible with the J**a version that Flutter is using ││ for Gradle. ││ ││ If you recently upgraded Android Studio, consult the migration guide at ││ https://flutter.dev/to/j**a-gradle-incompatibility. ││ ││ Otherwise, to fix this issue, first, check the J**a version used by Flutter by running
flutter │ │ doctor --verbose
. ││ ││ Then, update the Gradle version specified in ││ C:\jk-katalon\workspace\XXXX\XXXX-app\android\gradle\wrapper\gradle-wrapper.properties to be ││ compatible with that J**a version. See the link below for more information on compatible ││ J**a/Gradle versions: ││ https://docs.gradle.org/current/userguide/compatibility.html#j**a ││ ││ │└─────────────────────────────────────────────────────────────────────────────────────────────────┘