Skip to content

Update flutter/flutter ci.yaml to test against Java 25 - #193468

Merged
auto-submit[bot] merged 6 commits into
flutter:masterfrom
jesswrd:java-to-25
Oct 3, 2026
Merged

auto-submit[bot] merged 6 commits into
flutter:masterfrom
jesswrd:java-to-25

Conversation

@jesswrd

@jesswrd jesswrd commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Update flutter/flutter ci.yaml to test against Java 25.

Changes explained:

  • FlutterPluginUtilsTest: the IOException test mocked java.io.File and relied on FileInputStream(File) calling file.getPath() first. In JDK 25, the constructor calls the package-private File.isInvalid() first, so the strict MockK mock threw a MockKException instead of the expected IOException. The test now uses a real directory named build.gradle. Reading a directory throws FileNotFoundException on every JDK and platform.
    • JDK 21 FileInputStream(File) calls getPath() first (source). JDK 25 calls isInvalid() first (source).
    • The JDK 25 Javadoc says a FileNotFoundException is thrown if the file "is a directory rather than a regular file" (source).
  • Bump MockK 1.13.16 → 1.14.11 in the Flutter Gradle Plugin. MockK bundles Byte Buddy for inline mocking, and Byte Buddy must support the JDK that runs the tests (Java 25 requires Byte Buddy >= 1.17.5). MockK 1.13.16 depends on Byte Buddy 1.14.17, which rejects Java 25 class files ("Java 25 (69) is not supported by the current version of Byte Buddy"). That broke 29 FGP unit tests on JDK 25. MockK 1.14.11 depends on Byte Buddy 1.18.2.
    • Byte Buddy 1.17.5 release notes: "Update ASM to version 9.8 to support Java 25" (release notes).
    • MockK 1.13.16 uses Byte Buddy 1.14.17 (POM). MockK 1.14.11 uses Byte Buddy 1.18.2 (POM).
  • Bump mockito-core 5.8.0 → 5.20.0 in integration_test. Mockito bundles Byte Buddy, which must support the JDK running the tests. Mockito 5.8.0 depends on Byte Buddy 1.14.10, which rejects Java 25 class files, so FlutterDeviceScreenshotTest failed on JDK 25. Mockito 5.20.0 depends on Byte Buddy 1.17.7. This is the same version the engine's Android test_runner uses.
    • Mockito 5.8.0 uses Byte Buddy 1.14.10 (POM). Mockito 5.20.0 uses Byte Buddy 1.17.7 (POM).
  • Regenerated the 12 project-integration_test.lockfile files for the Mockito bump. Each changes mockito-core 5.8.0 → 5.20.0 and byte-buddy / byte-buddy-agent 1.14.10 → 1.17.7.

Partially Addresses #193404

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the open_jdk dependency version from version:21 to version:25.0.2 across multiple targets and platform properties in .ci.yaml. Feedback indicates that Java 25 is an unreleased version without a stable CIPD package, and it is currently unsupported by Gradle, which will cause CI build failures.

Comment thread .ci.yaml
{"dependency": "android_virtual_device", "version": "android_36_google_apis_x64.textpb"},
{"dependency": "avd_cipd_version", "version": "build_id:8719362231152674241"},
{"dependency": "open_jdk", "version": "version:21"},
{"dependency": "open_jdk", "version": "version:25.0.2"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Java 25 is an unreleased version of Java (scheduled for September 2025), and there is no stable open_jdk CIPD package for version:25.0.2. Furthermore, current Gradle versions (including Gradle 8.x and 9.x) do not support running on Java 25. Upgrading to this version will break CI builds. If the intention was to use a different version, please update it to a valid, supported Java version.

@jesswrd jesswrd changed the title Update flutter/flutter ci.yaml to test against Java 25 [DO NOT MERGE] Update flutter/flutter ci.yaml to test against Java 25 Sep 28, 2026
@jesswrd

jesswrd commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Do not merge until: #193467 has merged

@jesswrd jesswrd changed the title [DO NOT MERGE] Update flutter/flutter ci.yaml to test against Java 25 Update flutter/flutter ci.yaml to test against Java 25 Oct 1, 2026
@Piinks Piinks added platform-android Android applications specifically team-android Owned by Android platform team labels Oct 1, 2026
@github-actions github-actions Bot removed platform-android Android applications specifically team-android Owned by Android platform team labels Oct 2, 2026
@jesswrd

jesswrd commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

#193467 has been merged

… test

The test mocked java.io.File and relied on FileInputStream calling
File.getPath() before anything else. On JDK 25, FileInputStream calls the
package-private File.isInvalid() first, so the strict mock throws
MockKException instead of the expected IOException.

Use a real directory named build.gradle instead; reading it as text throws
an IOException on every platform and JDK.
MockK 1.13.16 depends on Byte Buddy 1.14.17, which rejects Java 25 class
files ("Java 25 (69) is not supported by the current version of Byte
Buddy"), failing 29 Flutter Gradle Plugin unit tests when CI runs on
JDK 25. MockK 1.14.11 depends on Byte Buddy 1.18.2.

Verified ./gradlew test (default AGP and -Pflutter.internal.agpVersion=9.3.1)
passes on JDK 21 and JDK 25.
… Java 25

mockito-core 5.8.0 depends on Byte Buddy 1.14.10, which rejects Java 25
class files, so FlutterDeviceScreenshotTest fails on JDK 25 (Linux
framework_tests_slow and plugin_test_android_standard on all platforms).
mockito-core 5.20.0 depends on Byte Buddy 1.17.7 (same objenesis 3.3) and
matches the version used by the engine's Android test_runner.

Update the integration_test lockfiles that pinned mockito-core 5.8.0 /
byte-buddy 1.14.10 accordingly.

Verified :integration_test:testDebugUnitTest passes on JDK 25 with
dependency locking enabled.
@jesswrd
jesswrd requested a review from a team as a code owner October 2, 2026 20:02
@jesswrd
jesswrd requested review from mboetger and removed request for a team October 2, 2026 20:02
@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. f: integration_test The flutter/packages/integration_test plugin team-android Owned by Android platform team labels Oct 2, 2026
@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 2, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 2, 2026
Merged via the queue into flutter:master with commit fbb2851 Oct 3, 2026
25 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 3, 2026
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
)

Update flutter/flutter `ci.yaml` to test against Java 25.

Changes explained:

- `FlutterPluginUtilsTest`: the IOException test mocked `java.io.File`
and relied on `FileInputStream(File)` calling `file.getPath()` first. In
JDK 25, the constructor calls the package-private `File.isInvalid()`
first, so the strict MockK mock threw a `MockKException` instead of the
expected `IOException`. The test now uses a real directory named
`build.gradle`. Reading a directory throws `FileNotFoundException` on
every JDK and platform.
- JDK 21 `FileInputStream(File)` calls `getPath()` first
([source](https://github.com/openjdk/jdk/blob/jdk-21-ga/src/java.base/share/classes/java/io/FileInputStream.java#L136-L146)).
JDK 25 calls `isInvalid()` first
([source](https://github.com/openjdk/jdk/blob/jdk-25-ga/src/java.base/share/classes/java/io/FileInputStream.java#L132-L136)).
- The JDK 25 Javadoc says a `FileNotFoundException` is thrown if the
file "is a directory rather than a regular file"
([source](https://github.com/openjdk/jdk/blob/jdk-25-ga/src/java.base/share/classes/java/io/FileInputStream.java#L120-L126)).
- Bump MockK `1.13.16` → `1.14.11` in the Flutter Gradle Plugin. MockK
bundles Byte Buddy for inline mocking, and Byte Buddy must support the
JDK that runs the tests (Java 25 requires Byte Buddy >= 1.17.5). MockK
1.13.16 depends on Byte Buddy 1.14.17, which rejects Java 25 class files
("Java 25 (69) is not supported by the current version of Byte Buddy").
That broke 29 FGP unit tests on JDK 25. MockK 1.14.11 depends on Byte
Buddy 1.18.2.
- Byte Buddy 1.17.5 release notes: "Update ASM to version 9.8 to support
Java 25" ([release
notes](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)).
- MockK 1.13.16 uses Byte Buddy 1.14.17
([POM](https://repo1.maven.org/maven2/io/mockk/mockk-agent-jvm/1.13.16/mockk-agent-jvm-1.13.16.pom)).
MockK 1.14.11 uses Byte Buddy 1.18.2
([POM](https://repo1.maven.org/maven2/io/mockk/mockk-agent-jvm/1.14.11/mockk-agent-jvm-1.14.11.pom)).
- Bump `mockito-core` `5.8.0` → `5.20.0` in `integration_test`. Mockito
bundles Byte Buddy, which must support the JDK running the tests.
Mockito 5.8.0 depends on Byte Buddy 1.14.10, which rejects Java 25 class
files, so `FlutterDeviceScreenshotTest` failed on JDK 25. Mockito 5.20.0
depends on Byte Buddy 1.17.7. This is the same version the engine's
Android `test_runner` uses.
- Mockito 5.8.0 uses Byte Buddy 1.14.10
([POM](https://repo1.maven.org/maven2/org/mockito/mockito-core/5.8.0/mockito-core-5.8.0.pom)).
Mockito 5.20.0 uses Byte Buddy 1.17.7
([POM](https://repo1.maven.org/maven2/org/mockito/mockito-core/5.20.0/mockito-core-5.20.0.pom)).
- Regenerated the 12 `project-integration_test.lockfile` files for the
Mockito bump. Each changes `mockito-core` 5.8.0 → 5.20.0 and
`byte-buddy` / `byte-buddy-agent` 1.14.10 → 1.17.7.

Partially Addresses flutter#193404

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests CICD Run CI/CD f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants