Skip to content

[Android 16] Updating Engine to Use Java 21 #167776

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jesswrd
Copy link
Contributor

@jesswrd jesswrd commented Apr 24, 2025

Bumping the engine to use Java 21.

Some Java 21 changes that affect our tests:

  • Starting JDK 19, we can no longer use Mockito's mock to fake the ByteBuffer class (mockito issue here). I replaced the usage with a captor instead.
  • Included in the Java 21 Release here are unicode updates that specifically affect chinese characters. It likely affects this unicode accessibility test itCanPredictCursorMovementsWithGranularityWordUnicode in AccessiblityBridgeTest.java, which uses chinese characters.

To reproduce the error in AccessiblityBridgeTest.java locally, follow these steps:

  1. Run et build -c android_debug_unopt
  2. Run gclient sync -D from root
  3. Navigate to engine/src/flutter/third_party/java/openjdk/openjdk.cipd.yaml to make sure JDK 21 has been properly generated. If you see "OpenJDK 21," it has been properly generated.
  4. Navigate to engine/src/flutter and run testing/run_tests.py --android-variant=android_debug_unopt --type=java --java-filter=io.flutter.view.AccessibilityBridgeTest

Pre-launch Checklist

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

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine repository. See also e: labels. labels Apr 24, 2025
@jesswrd jesswrd changed the title Java 21 engine Updating Engine to Use Java 21 Apr 24, 2025
@jesswrd jesswrd changed the title Updating Engine to Use Java 21 [Android 16] Updating Engine to Use Java 21 Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant