Repository navigation
Update flutter/flutter ci.yaml to test against Java 25 - #193468
Conversation
There was a problem hiding this comment.
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.
| {"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"}, |
There was a problem hiding this comment.
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.
ci.yaml to test against Java 25ci.yaml to test against Java 25
|
Do not merge until: #193467 has merged |
ci.yaml to test against Java 25ci.yaml to test against Java 25
|
#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.
) 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
Update flutter/flutter
ci.yamlto test against Java 25.Changes explained:
FlutterPluginUtilsTest: the IOException test mockedjava.io.Fileand relied onFileInputStream(File)callingfile.getPath()first. In JDK 25, the constructor calls the package-privateFile.isInvalid()first, so the strict MockK mock threw aMockKExceptioninstead of the expectedIOException. The test now uses a real directory namedbuild.gradle. Reading a directory throwsFileNotFoundExceptionon every JDK and platform.FileInputStream(File)callsgetPath()first (source). JDK 25 callsisInvalid()first (source).FileNotFoundExceptionis thrown if the file "is a directory rather than a regular file" (source).1.13.16→1.14.11in 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.mockito-core5.8.0→5.20.0inintegration_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, soFlutterDeviceScreenshotTestfailed on JDK 25. Mockito 5.20.0 depends on Byte Buddy 1.17.7. This is the same version the engine's Androidtest_runneruses.project-integration_test.lockfilefiles for the Mockito bump. Each changesmockito-core5.8.0 → 5.20.0 andbyte-buddy/byte-buddy-agent1.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-assistbot 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.