Skip to content

Fix Android Studio pluginsPath when version is unknown (do not use 0.0)#182681

Merged
auto-submit[bot] merged 4 commits intoflutter:masterfrom
jhonathanqz:fix/plugin-path
Mar 18, 2026
Merged

Fix Android Studio pluginsPath when version is unknown (do not use 0.0)#182681
auto-submit[bot] merged 4 commits intoflutter:masterfrom
jhonathanqz:fix/plugin-path

Conversation

@jhonathanqz
Copy link
Contributor

Fix Android Studio pluginsPath when version is unknown (do not use 0.0)

This PR fixes a bug in the Android tooling where AndroidStudio.pluginsPath treated an unknown version as 0.0, returning a wrong path (e.g. AndroidStudio0.0 or .AndroidStudio0.0) that does not exist. See the in-repo TODO and #121468.

What changes: When version is null (unknown), we no longer use major = 0 and minor = 0 to build the path. Instead:

  • On macOS: pluginsPath returns null (we cannot derive a valid path without the version).
  • On Linux/Windows: we first check the JetBrains Toolbox plugins path (directory.plugins); if that directory exists we return it; otherwise we return null.

Why: Treating unknown version as 0.0 pointed to non-existent paths and could confuse tooling or users. Returning null when the path cannot be determined is correct; callers already handle a null pluginsPath.

Issues fixed: Fixes #121468 (and removes the TODO(andrewkolos) in android_studio.dart).

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
N/A — no changes in flutter/tests.

Pre-launch Checklist

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

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.

@jhonathanqz jhonathanqz requested a review from a team as a code owner February 20, 2026 19:12
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Feb 20, 2026
Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

The pull request correctly addresses the issue where an unknown Android Studio version was treated as 0.0, which resulted in incorrect plugin paths. The implementation handles the version == null case by returning null on macOS and checking for a JetBrains Toolbox plugins directory on other platforms. I have suggested a minor refactoring to consolidate the Toolbox path logic and avoid duplication, as well as adding a test case for the macOS scenario to ensure full coverage. The review adheres to the Flutter Style Guide, specifically focusing on readability, avoiding duplication, and maintaining high test standards.

@camsim99 camsim99 self-requested a review February 24, 2026 21:48
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, thanks for the fix!

@jesswrd jesswrd requested a review from gmackall March 10, 2026 21:01
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 17, 2026
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 17, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 17, 2026

autosubmit label was removed for flutter/flutter/182681, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@camsim99 camsim99 added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Mar 17, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Mar 17, 2026
Merged via the queue into flutter:master with commit b16b6fc Mar 18, 2026
150 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 18, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Mar 19, 2026
flutter/flutter@d117642...dd64978

2026-03-18 [email protected] Roll Skia from 2fb5fa71eb12 to f0a13e5efbad (2 revisions) (flutter/flutter#183830)
2026-03-18 [email protected] Roll Skia from ae3d36cb9e29 to 2fb5fa71eb12 (3 revisions) (flutter/flutter#183823)
2026-03-18 [email protected] Linux reuse sibling (flutter/flutter#183653)
2026-03-18 [email protected] Roll Skia from 84a180a1fa80 to ae3d36cb9e29 (4 revisions) (flutter/flutter#183812)
2026-03-18 [email protected] fix(web): handle asynchronously disposed platform views (flutter/flutter#183666)
2026-03-17 [email protected] (Test cross-imports) Remove legacy Material import from sliver_constraints_test (flutter/flutter#183351)
2026-03-17 [email protected] Fix Android Studio pluginsPath when version is unknown (do not use 0.0) (flutter/flutter#182681)
2026-03-17 [email protected] Fixes animation glitch into bottom sheet (flutter/flutter#183303)
2026-03-17 [email protected] Handle#6537 second grouped test (flutter/flutter#182529)
2026-03-17 [email protected] Add a Clarification for the docs of suggestionsBuilder of SearchAnchor (flutter/flutter#183106)
2026-03-17 [email protected] Remove obsolete null checks from style guide (flutter/flutter#181703)
2026-03-17 [email protected] [Impeller] Do not delete the GL object in a HandleGLES if the handle has a cleanup callback (flutter/flutter#183561)
2026-03-17 [email protected] Encode source file patches as UTF-8 in the code formatter script (flutter/flutter#183761)
2026-03-17 [email protected] Fix widget inspector control layout and add safe area regression test (flutter/flutter#180789)
2026-03-17 [email protected] Reland "[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)" (flutter/flutter#182522)
2026-03-17 [email protected] fix(web): fix crash in Skwasm when transferring non-transferable texture sources (flutter/flutter#183799)
2026-03-17 [email protected] Roll Skia from dba893a44d7a to 84a180a1fa80 (7 revisions) (flutter/flutter#183803)
2026-03-17 [email protected] Framework: Improve DropdownButton selectedItemBuilder assertion (flutter/flutter#183732)
2026-03-17 [email protected] Add mainAxisAlignment to NavigationRail (flutter/flutter#183514)
2026-03-17 [email protected] Update android triage process to not look at unassigned p1s every week (flutter/flutter#183805)
2026-03-17 [email protected] Adds macos impeller new gallery transition perf test. (flutter/flutter#183802)
2026-03-17 [email protected] fix(web_ui): move prepareToDraw after raster to improve concurrency and stability (flutter/flutter#183791)
2026-03-17 [email protected] [build] Generate debug info for assembly. (flutter/flutter#183425)
2026-03-17 [email protected] [web] Fix occasional failure to find Chrome tab (flutter/flutter#183737)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD 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.

Explicitly configured Android Studio is always treated as ancient version, breaking build

3 participants