You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Engine][Android] Fix Mockito dynamic agent loading warnings in Robolectric tests for JDK compatibility #189148
When running Android engine Robolectric tests (e.g., ./flutter/testing/run_tests.py --type java), Mockito emits deprecation warnings when self-attaching the inline-mock-maker agent on newer JDK releases (JDK 21+):
Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
WARNING: A Java agent has been loaded dynamically (/var/folders/4p/.../byteBuddyAgent...jar)
WARNING: Dynamic loading of agents will be disallowed by default in a future release
To ensure tests do not break when upgrading to future JDK releases where dynamic agent loading is disallowed by default, Mockito should be explicitly configured as a -javaagent in the test JVM arguments, or dynamic agent loading should be explicitly enabled.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Fix Mockito dynamic agent loading warnings in Robolectric tests (flut…
github-actions commentedon Aug 5, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.