Skip to content

fix: BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 #1163

@neiljaywarner

Description

@neiljaywarner

Description

Android did not "just work" out of the box with zero changes on my 4 day old mac with as minimal of a setup as possible, but flutter create did.
(I'm on flutter stable channel Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2663184aa7 (4 weeks ago) • 2024-09-11 16:27:48 -0500 )

Steps To Reproduce

  1. very_good create flutter_app testapp --desc "test app" --org "com.example" --application-id "com.example.testapp"
  2. File open

Expected Behavior

app launches on android and displays counter app on Android as it does on iOS

Additional Context

Mac m3 pro nov 2023, was purchased 4 days ago and just setup with flutter stable, android studio stable (ladybug just downloaded in the last few days) as minimal configuration as possible.

flutter run --flavor development --target lib/main_development.dart
Connected devices:
Pixel 6 (mobile) • 24061FDF6003TX • android-arm64 • Android 15 (API 35)
iPhone 16 (mobile) • 9DE9E8A1-59FF-4B10-87EC-3969DD66DE54 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-0
(simulator)
macOS (desktop) • macos • darwin-arm64 • macOS 14.6 23G80 darwin-arm64
Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6 23G80 darwin-arm64
Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.100

No wireless devices were found.

[1]: Pixel 6 (24061FDF6003TX)
[2]: iPhone 16 (9DE9E8A1-59FF-4B10-87EC-3969DD66DE54)
[3]: macOS (macos)
[4]: Mac Designed for iPad (mac-designed-for-ipad)
[5]: Chrome (chrome)
Please choose one (or "q" to quit): 1
Launching lib/main_development.dart on Pixel 6 in debug mode...

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not open cp_settings generic class cache for settings file '/Users/neil/code/downstream/android/settings.gradle' (/Users/neil/.gradle/caches/7.5/scripts/6202moigwc1bc6g9dczefyu8l).

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.

BUILD FAILED in 788ms
Running Gradle task 'assembleDevelopmentDebug'... 1,287ms

┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using for Gradle. │
│ │
│ If you recently upgraded Android Studio, consult the migration guide at https://flutter.dev/to/to/java-gradle-incompatibility. │
│ │
│ Otherwise, to fix this issue, first, check the Java version used by Flutter by running flutter doctor --verbose. │
│ │
│ Then, update the Gradle version specified in /Users/neil/code/redacted_dir/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
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDevelopmentDebug failed with exit code 1
neil@Neils-MacBook-Pro downstream %

here is relevant part of flutter doctor --verbose output
`
neil@Neils-MacBook-Pro downstream % flutter doctor --verbose
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6 23G80 darwin-arm64, locale en-US)
• Flutter version 3.24.3 on channel stable at /Users/neil/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/neil/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.

`

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expectedp1High-priority issues at the top of the work list

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions