Your projects Gradle version is incompatible with the Java version that Flutter is using for Gradle

Опубликовано: 14 Сентябрь 2024
на канале: Mithun FLutter
25k
162

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\ACER\StudioProjects\api\android\build.gradle' line: 26

* What went wrong:
A problem occurred evaluating root project
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'C:\Users\ACER\StudioProjects\api\android\app\build.gradle' (C:\Users\ACER\.gradle\caches\7.5\scripts\1zv228zicgwf9trdgw6csl7pj).
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64

* 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.

BUILD FAILED in 4s

┌─ ─────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using │
│ for Gradle. │
│ │
│ To fix this issue, first, check the Java version used by Flutter by running `flutter doctor │
│ --verbose`. │
│ │
│ Then, update the Gradle version specified in │
│ C:\Users\ACER\StudioProjects\api\android\gradle\wrapper\gradle-wrapper.properties to be │
│ compatible with that Java version. See the link below for more information on compatible │
│ Java/Gradle versions: │
│ https:/docs.gradle.org/current/userguide/compatibility.html │
│ │
│ │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1

#