如何修复这个gradle构建失败的Flutter?

niwlg2el  于 2023-03-03  发布在  Flutter
关注(0)|答案(1)|浏览(325)

我正在尝试学习如何创建Flutter应用程序并将其连接到Firebase,在我学习的课程中,讲师在终端中写下了以下一行:

./gradlew signingreport

所以现在的总体路径是这样的:

PS C:\Users\Rashed\Desktop\workspace\firebase_practice\android> ./gradlew signingreport

但当我这样做时,我遇到了这个错误:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Rashed\Desktop\workspace\firebase_practice\android\build.gradle' line: 26

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Could not open proj generic class cache for build file 'C:\Users\Rashed\Desktop\workspace\firebase_practice\android\app\build.gradle' (C:\Users\Rashed\.gradle\caches\7.5\scripts\47ckv1l1dgtaf1eupsm27romw).
      > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* 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 673ms

请注意,这是一个全新的项目,这意味着我还没有写一行。

知道如何修复此错误吗?

7vhp5slm

7vhp5slm1#

请尝试将Java版本更新为与Gradle构建系统兼容的版本。此外,您可能需要更新Gradle版本或通过删除C:\Users\Rashed.gradle\caches文件夹来清理Gradle缓存,然后重新构建项目。

相关问题