flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
163.57k stars 26.9k forks source link

`flutter doctor` should warn if the Android (emulator) AVD version is "old" #146297

Open matanlurey opened 3 months ago

matanlurey commented 3 months ago

flutter doctor currently outputs (something) like this:

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.0, on macOS 14.4 23E214 darwin-arm64, locale
    en)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.87.2)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

We'd like to add a warning in the Android emulator (AVD) version is lower than an expected "newer" version.

We discovered this can be queried via:

% $ANDROID_HOME/emulator/emulator --version
33.1.17.0 (build_id 10594030)

Steps:

Context

As we get closer to releasing Impeller on Android, we've discovered that Vulkan and Vulkan Validation Errors were not fully supported, and even worked with the Android team to get bug fixes to avoid emulator crashes.

Emulators are a primary way many developers work on their Flutter application, especially if they are developing for Android, so it will become surprising that (older) emulator binaries crash when we switch the default to --enable-impeller.

/cc @reidbaker @christopherfujino

As I mentioned in the engine weekly, this up for grabs.

jmagman commented 3 months ago

Some prior art for required and recommended Xcode versions: https://github.com/flutter/flutter/blob/1d89ae3f6555028e983e5e567aaabeab153596a9/packages/flutter_tools/lib/src/macos/xcode_validator.dart#L57-L63

https://github.com/flutter/flutter/blob/1d89ae3f6555028e983e5e567aaabeab153596a9/packages/flutter_tools/lib/src/base/user_messages.dart#L167-L173

Note recommended and required are currently the same, but they have diverged in the past:

https://github.com/flutter/flutter/blob/1d89ae3f6555028e983e5e567aaabeab153596a9/packages/flutter_tools/lib/src/macos/xcode.dart#L23-L27

reidbaker commented 3 months ago

--version I do not think will work You want -version

flutter-triage-bot[bot] commented 3 months ago

The fyi-tool label is redundant with the team-tool label.

matanlurey commented 3 months ago

Thanks for picking this up Andrew/Chris. If there is anything we can do to help reach out myself or Jonah.

andrewkolos commented 2 months ago

@matanlurey (cc: @jonahwilliams) Barring any surprises, I think I could implement this pretty quickly. However, what is unclear to me is the threshold is for an AVD version being "outdated" is. Should it be <33.X? <34.X?

matanlurey commented 2 months ago

I suspect let's just pick the newest AVD as the minimum, and document how/when to bump that number.

andrewkolos commented 2 months ago

As discussed in the most recent Tools & Engine weekly meeting, this is being deprioritized. Feel free to reassign me if this issue becomes more significant.

christopherfujino commented 2 months ago

@matanlurey what's the deadline for getting this in?

matanlurey commented 2 months ago

@matanlurey what's the deadline for getting this in?

It would be best to add this by the same release that makes Impeller on Android the default.

It's also not critical, like we could just document "use the latest AVD" and prioritize the tool improvements if we see a lot of users complain?

/cc @jonahwilliams