Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Gradle in example apps so it's possible to build them on the latest JDK #2503

Merged

Conversation

bartekpacia
Copy link
Contributor

@bartekpacia bartekpacia commented Jan 23, 2025

Gradle 8.9 doesn't support the latest stable Java 23. (see Gradle-Java compatibility matrix)

Java 23 is the default when using brew install openjdk (which is arguably a very popular way to install JDK on macOS). I use it.

Repro

$ brew install openjdk
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home
$ cd packages/patrol/example
$ flutter build apk --config-only
cd android && ./gradlew :app:assembleDebug

Results in:

FAILURE: Build failed with an exception.

* What went wrong:
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 67
> 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 26s
Running Gradle task 'assembleDebug'...                             27.5s

Note

Using flutter build apk --debug works because by default, it ignores $JAVA_HOME and defaults to the Java bundled in IntelliJ IDEA/Android Studio. Still, when the developer calls flutter config --jdk-dir "$JAVA_HOME (and JDK 23 is in $JAVA_HOME), the same problem occurs.

Copy link

docs-page bot commented Jan 23, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/leancodepl/patrol~2503

Documentation is deployed and generated using docs.page.

@github-actions github-actions bot added the package: patrol Related to the patrol package (native automation, test bundling) label Jan 23, 2025
@bartekpacia bartekpacia changed the title Bump Gradle Bump Gradle in example apps so it's possible to build them on the latest JDK Jan 23, 2025
Copy link
Collaborator

@pdenert pdenert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok, but please add entry to patrol package changelog

@bartekpacia bartekpacia force-pushed the chore/bump_gradle_to_latest_everywhere branch from 25e74ba to f385b6b Compare January 28, 2025 19:30
@bartekpacia
Copy link
Contributor Author

Sure, done!

@pdenert
Copy link
Collaborator

pdenert commented Jan 29, 2025

Thanks! And now resolve the conflict please 😉

Copy link
Collaborator

@pdenert pdenert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pdenert pdenert merged commit f796603 into leancodepl:master Jan 30, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants