Many samples use old Gradle, impossible to build on modern JDK

Offen
#2,568 0 Kommentare 2 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@ericwindmill arbeitet bereits daran.

Seit 27.1.2025.

  • #2873 von @GhagSagar23 — offen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

bug

E.g. running flutter build apk --debug in add_to_app/books/flutter_module_books results in:

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file '/Users/bartek/projects/flutter-samples/add_to_app/books/flutter_module_books/.android/settings.gradle' (/Users/bartek/.cache/gradle/caches/8.0/scripts/4pgstqpbdapknfa7p7f6rr9s5).
> 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

BUILD FAILED in 2s

I'm using the latest stable JDK:

$ java --version
openjdk 23.0.2 2025-01-21
OpenJDK Runtime Environment Homebrew (build 23.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 23.0.2, mixed mode, sharing)

Action item 1: update all samples to Gradle 8.12 (latest as of now)

Action item 2: maybe think of some automation to update those versions automatically?

Vorherrschende Sprache
Dart
Sterne
19.3k
Forks
7.8k
Ø Merge
1 T. 18 Std.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus flutter/samples

Alle Issues in flutter/samples

Ähnliche Issues

Weitere Issues zu Dart

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.