Skip to content

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

@bartekpacia

Description

@bartekpacia

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions