A problem occurred configuring root project 'android'.
> Could not open proj generic class cache for build file '/xxx/android/build.gradle' (/xx/.gradle/caches/7.5/scripts/akwrc0u19blmw1a04l6gh2lez).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 67
* 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
复制代码
问题二:Execution failed for task ':gradle:compileGroovy'.
当你发现你本地的jdk版本和gradle的版本对上时,运行的时候还会出现这种报错。
Execution failed for task ':gradle:compileGroovy'.
> BUG! exception in phase 'semantic analysis' in source unit '/xxxx/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' 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.
那你就须要执行以下命令来检察flutter使用的是那个版本的jdk:
flutter doctor -v
在Android Studio这一行中,检察
[✓] Android Studio (version 2024.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from: