Skip to content

"Gradle version is incompatible with the Java version" but flutter doctor is all green #130515

@Lars-Hoofs

Description

@Lars-Hoofs

Is there an existing issue for this?

Steps to reproduce

  1. Make a project with the command 'Flutter create Name'
  2. Open the project in visual studio
  3. CD to directory
  4. Flutter run

Actual results

The actual result should be that the app displays on my phone

Logs

PS C:\Users\Lars hoofs\Documents\flutter-apps\clocko> flutter run
Launching lib\main.dart on Pixel 6a in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\Lars hoofs\Documents\flutter-apps\clocko\android\settings.gradle' (C:\Users\Lars hoofs\.gradle\caches\7.5\scripts\3d075fs9hjp81ny0sgym4v09w).
> 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 864ms
Running Gradle task 'assembleDebug'...                           1.656ms

┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐   
│ [!] 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\Lars hoofs\Documents\flutter-apps\clocko\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#java                                                                                                                                     │   
│                                                                                                                                                                                                       │   
│                                                                                                                                                                                                       │   
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘   
Exception: Gradle task assembleDebug failed with exit code 1

Flutter Doctor output

Doctor output
C:\Users\Lars hoofs>Flutter doctor -v
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1928], locale nl-NL)
    • Flutter version 3.10.5 on channel stable at C:\Users\Lars hoofs\Documents\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Lars hoofs\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 20.0.1+9-29)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.3.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Enterprise
    • Visual Studio Enterprise 2022 version 17.3.32929.385
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.80.0)
    • VS Code at C:\Users\Lars hoofs\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.68.0

[√] Connected device (4 available)
    • Pixel 6a (mobile) • 28251JEGR15601 • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows        • windows-x64    • Microsoft Windows [Version 10.0.22621.1928]
    • Chrome (web)      • chrome         • web-javascript • Google Chrome 114.0.5735.199
    • Edge (web)        • edge           • web-javascript • Microsoft Edge 114.0.1823.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

C:\Users\Lars hoofs>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1928], locale nl-NL)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.3.6)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.80.0)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

d: api docsIssues with https://api.flutter.dev/platform-androidAndroid applications specificallyt: flutter doctorProblem related to the "flutter doctor" toolt: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions