Skip to content

flutter doctor should explicitly say when it can't find Android Studio version #122081

@gnprice

Description

@gnprice

When the tool isn't able to identify what version an Android Studio installation is, that can cause the build to fail because some logic depends on the Android Studio version. For example:

So when someone's running flutter doctor -v because things have gone wrong, the fact that the Android Studio version couldn't be identified is potentially a quite important clue for resolving the problem.

Currently, though, the flutter doctor output just suppresses mention of the version when it doesn't know the answer:

    // in [AndroidStudioValidator.validate]
    final String? studioVersionText = _studio.version == Version.unknown
      ? null
      : userMessages.androidStudioVersion(_studio.version.toString());

The result is a line like

[!] Android Studio

instead of like

[✓] Android Studio (version 2022.3)

This is too subtle; e.g. in #121925 it wasn't noticed in the first few rounds of debugging. It should instead say something like:

[!] Android Studio (unknown version)

or perhaps somewhat louder than that.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listplatform-androidAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions