flutter/packages/flutter_tools/test/general.shard
Mikhail Novoseltsev ae6d79336e
[tool] fix android studio preview's version parsing (#156293)
This PR willing to fix issue when `flutter doctor` validator can't determine version of Android Studio EAP.

These are before/after outputs of `flutter doctor -v` showcasing change in behaviour of validator. Each output has 3 `Android Studio` sections, 1 for stable and 2 for different EAP versions. 

<details>
<summary>before, (stable, 3.24.3), 2 issues related to versions of Android Studio</summary>

```console
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.7 23H124 darwin-arm64, locale en-RU)
    • Flutter version 3.24.3 on channel stable at /Users/samer/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/samer/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /Users/samer/Library/Java/JavaVirtualMachines/jbr-17.0.7/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment JBR-17.0.7+7-964.1-nomod (build 17.0.7+7-b964.1)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-16.0.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Users/samer/Applications/Android Studio Koala Feature Drop 2024.1.2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[!] Android Studio (version unknown)
    • Android Studio at /Users/samer/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[!] Android Studio (version unknown)
    • Android Studio at /Users/samer/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version EAP IU-243.12818.47)
    • IntelliJ at /Users/samer/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.94.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.98.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554             • android-arm64  • Android 15 (API 35) (emulator)
    • iPhone (Михаил) (mobile)        • 00008020-001254DA1E39002E • ios            • iOS 17.6.1 21G93
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.7 23H124 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.7 23H124 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 129.0.6668.90
    ! Error: Browsing on the local area network for Михаил Новосельцев’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```
</details>

<details>
<summary>after,  no issues regarding Android Studio</summary>

```console
[!] Flutter (Channel [user-branch], 3.26.0-1.0.pre.383, on macOS 14.7 23H124 darwin-arm64, locale en-RU)
    ! Flutter version 3.26.0-1.0.pre.383 on channel [user-branch] at /Users/samer/projects/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    • Upstream repository git@github.com:Sameri11/flutter.git
    • FLUTTER_GIT_URL = git@github.com:Sameri11/flutter.git
    • Framework revision 852508425d (20 minutes ago), 2024-10-07 21:22:45 +0500
    • Engine revision 683a14c1f1
    • Dart version 3.6.0 (build 3.6.0-326.0.dev)
    • DevTools version 2.40.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update
      checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/samer/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /Users/samer/Library/Java/JavaVirtualMachines/jbr-17.0.7/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment JBR-17.0.7+7-964.1-nomod (build 17.0.7+7-b964.1)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-16.0.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Users/samer/Applications/Android Studio Koala Feature Drop 2024.1.2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Android Studio (version 2024.2.2)
    • Android Studio at /Users/samer/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] Android Studio (version 2024.2.1)
    • Android Studio at /Users/samer/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version EAP IU-243.12818.47)
    • IntelliJ at /Users/samer/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.94.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.98.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554             • android-arm64  • Android 15 (API 35) (emulator)
    • iPhone (Михаил) (mobile)        • 00008020-001254DA1E39002E • ios            • iOS 17.6.1 21G93
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.7 23H124 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.7 23H124 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 129.0.6668.90
    ! Error: Browsing on the local area network for Михаил Новосельцев’s iPad. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```
</details>

Logic behind these changes explained in https://github.com/flutter/flutter/issues/121925#issuecomment-2352826925 

fixes #121925

**Tests**: updated existing tests by adding version checking, but I don't mind writing new ones if necessary – please tell me if so.
2024-10-16 15:56:31 +00:00
..
android [tool] fix android studio preview's version parsing (#156293) 2024-10-16 15:56:31 +00:00
base handle EAGAIN (macOS) in ErrorHandlingProcessManager (#154306) 2024-09-10 22:24:56 +00:00
build_system Fix JS compilation to use the command 'compile js' instead of using snapshot names to invoke dart2js (#156735) 2024-10-15 15:28:27 -07:00
commands Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
custom_devices Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
dap [tool] Guard more write/writeln calls on Process.stdin (#151146) 2024-07-23 19:27:52 +00:00
dart Do not silently fail pub get even if output-mode is "none" (#153596) 2024-08-22 09:12:54 -07:00
drive Document that flutter drive --test-arguments can opt-in to dart test (#152410) 2024-07-26 18:25:58 -07:00
intellij Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
ios Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
isolated Remove left-over traces of "link-dry-run" - which isn't used anywhere in flutter (#155820) 2024-09-27 16:45:35 +02:00
linux Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
macos Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
migrations Add migration to git ignore SwiftPM build directories (#152766) 2024-08-05 20:26:16 +00:00
proxied_devices Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386) 2024-07-26 20:51:19 +00:00
reporting [flutter_tools] fix instructions to disable CLI animations (#139094) 2023-11-27 22:00:50 +00:00
runner Updated iPhone enable developer mode instructions (#154511) 2024-10-12 06:23:13 +00:00
test Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
tester Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
vscode Added support for vscode and vscode-insiders installed via Flatpak (#137123) 2023-12-04 21:59:53 +00:00
web Fix JS compilation to use the command 'compile js' instead of using snapshot names to invoke dart2js (#156735) 2024-10-15 15:28:27 -07:00
windows Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
analytics_test.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
android_plugin_test.dart
application_package_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
args_test.dart [web] hide the --web-renderer option in the tool (#152683) 2024-08-07 18:40:58 +00:00
artifact_updater_test.dart iOS,macOS: Do not copy unsigned_binaries.txt to build outputs (#154684) 2024-09-05 21:37:28 +00:00
artifacts_test.dart Fix JS compilation to use the command 'compile js' instead of using snapshot names to invoke dart2js (#156735) 2024-10-15 15:28:27 -07:00
asset_bundle_flavors_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
asset_bundle_package_fonts_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
asset_bundle_package_test.dart Fix flavor-conditional asset bundling for path dependencies (#156687) 2024-10-15 17:39:01 +00:00
asset_bundle_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
asset_bundle_variant_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
asset_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
base_utils_test.dart Fixed race condition in PollingDeviceDiscovery. (#145506) 2024-03-21 22:37:08 +00:00
build_info_test.dart Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
bundle_builder_test.dart Fix asset transformation in the presence of resolution-aware asset variants (#151932) 2024-07-22 23:46:19 +00:00
cache_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
channel_test.dart [flutter_tools] Suppress git output in flutter channel (#128475) 2023-06-13 19:28:06 +00:00
cmake_test.dart Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
cold_test.dart when setting up the log reader for a device during flutter run, discard any RPCError thrown due to the device being disconnected (#155049) 2024-09-12 15:42:15 +00:00
common_test.dart
compile_batch_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
compile_expression_test.dart Roll engine, patch expression evaluation (#128255) 2023-06-07 19:48:42 +00:00
compile_incremental_test.dart Remove --disable-dart-dev across flutter/flutter. (#154280) 2024-08-29 22:50:04 +00:00
compile_test.dart Remove toString() overrides in dart:ui/package:flutter in profile/release mode on wasm/vm targets (#144763) 2024-03-08 09:55:02 +01:00
config_test.dart
convert_test.dart
coverage_collector_test.dart Roll pub packages (#154267) 2024-08-29 16:28:08 +00:00
crash_reporting_test.dart Swap crash reporting with unified analytics (#148525) 2024-05-18 01:30:13 +00:00
create_config_test.dart Suggest a potential valid name for the flutter project when using flutter create (#130900) 2023-07-21 19:09:25 +00:00
daemon_test.dart [flutter_tools] Fix missing stack trace from daemon (#144113) 2024-02-27 08:39:49 +00:00
dart_plugin_test.dart [tool] Add dartFileName setting for platform plugins (#153099) 2024-09-06 18:27:09 +00:00
desktop_device_test.dart Disable sandboxing for macOS apps and tests in CI (#149618) 2024-06-04 21:51:19 +00:00
devfs_test.dart Reland "Load parent package config" (#153754) 2024-08-20 15:30:46 +02:00
device_port_forwarder_test.dart
device_test.dart Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386) 2024-07-26 20:51:19 +00:00
device_vm_service_discovery_for_attach_test.dart Support mdns when attaching to proxied devices. (#146021) 2024-04-09 20:00:21 +00:00
devtools_launcher_test.dart Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386) 2024-07-26 20:51:19 +00:00
emulator_test.dart Fixed few typos (#147087) 2024-04-22 16:49:19 +00:00
fake_process_manager_test.dart [tool] Fix stdin.flush calls on processes started by FakeProcessManager (#151183) 2024-07-02 20:40:06 +00:00
features_test.dart [Swift Package Manager] Make available but off on beta and stable (#155964) 2024-10-01 18:00:10 +00:00
flutter_manifest_assets_test.dart add parsing of assets transformer declarations in pubspec.yaml (#143557) 2024-02-16 22:24:59 +00:00
flutter_manifest_assets_transformers_test.dart add parsing of assets transformer declarations in pubspec.yaml (#143557) 2024-02-16 22:24:59 +00:00
flutter_manifest_test.dart add default-flavor field to flutter pubspec, which will be used as the flavor in flutter build/run if --flavor is not provided (#147968) 2024-05-22 05:11:24 +00:00
flutter_platform_test.dart Catch unable to start app exception (#154970) 2024-09-16 17:32:49 +00:00
flutter_project_metadata_test.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
flutter_tester_device_test.dart Update the signature of DDS launcher callback. (#154949) 2024-09-11 17:39:20 +00:00
flutter_validator_test.dart Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
generate_localizations_test.dart [gen_l10n] isCustomDateFormat accepts an actual boolean (#153439) 2024-08-18 08:57:30 -07:00
github_template_test.dart Added missing code block language in docs (#147481) 2024-05-01 14:44:27 +00:00
hot_shared.dart Reverts "[tool] Guard process writes to frontend server in ResidentCompiler (#152358)" (#153028) 2024-08-07 16:11:26 +00:00
hot_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
integration_test_device_test.dart Do not cancel the VmService's subscription to the isolate event stream in FlutterVmService.findExtensionIsolate (#153607) 2024-08-19 17:40:07 +00:00
license_collector_test.dart
mdns_discovery_test.dart Clean up lint ignores (#144229) 2024-02-27 23:21:03 +00:00
message_parser_test.dart Relax syntax for gen-l10n (#130736) 2023-07-18 13:59:48 -07:00
persistent_tool_state_test.dart
plugin_parsing_test.dart [tool] Add dartFileName setting for platform plugins (#153099) 2024-09-06 18:27:09 +00:00
plugins_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
preview_device_test.dart [flutter_tools] Ensure flutter daemon clients can detect preview device (#140112) 2023-12-21 19:01:16 +00:00
project_file_invalidator_test.dart Reland "Load parent package config" (#153754) 2024-08-20 15:30:46 +02:00
project_test.dart Add a RegExp for iOS domain when reading domains from xcodeProject (#154201) 2024-08-30 11:17:29 -07:00
project_validator_result_test.dart
protocol_discovery_test.dart
pub_dependencies_project_validator_test.dart
resident_devtools_handler_test.dart Do not cancel the VmService's subscription to the isolate event stream in FlutterVmService.findExtensionIsolate (#153607) 2024-08-19 17:40:07 +00:00
resident_runner_helpers.dart when setting up the log reader for a device during flutter run, discard any RPCError thrown due to the device being disconnected (#155049) 2024-09-12 15:42:15 +00:00
resident_runner_test.dart when ResidentRunner.tryInitLogReader fails, only log warning on Android (#155800) 2024-09-30 17:53:08 +00:00
resident_web_runner_cold_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
resident_web_runner_test.dart Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
run_hot_test.dart Clean up lint ignores (#144229) 2024-02-27 23:21:03 +00:00
template_test.dart Locate the template directory using a TemplatePathProvider. (#132156) 2023-08-08 21:43:00 +00:00
terminal_handler_test.dart [flutter_tools] remove raster stats CLI option. (#152501) 2024-07-29 20:30:54 +00:00
testbed_test.dart
time_test.dart
tracing_test.dart [flutter_tools] Catch rpc error in render frame with raster stats (#144190) 2024-02-28 18:54:18 +00:00
unified_analytics_test.dart Bump dependencies in Flutter (#147546) 2024-04-29 15:53:25 -07:00
update_packages_test.dart Allow explicit exclusion of packages from pinned packages in flutter update-packages --force-update (#147679) 2024-05-02 01:16:54 +00:00
utils_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
version_test.dart [flutter_tools] Fix "FormatException: Invalid date format" during version freshness check (#134088) 2023-09-06 17:22:13 +00:00
vmservice_test.dart Do not cancel the VmService's subscription to the isolate event stream in FlutterVmService.findExtensionIsolate (#153607) 2024-08-19 17:40:07 +00:00
web_template_test.dart Flutter Web Bootstrapping Improvements (#144434) 2024-03-12 22:41:26 +00:00
windows_version_validator_test.dart [ Tool ] Support Powershell v6+ to determine Windows version in flutter doctor (#156476) 2024-10-15 11:48:35 -04:00
xcode_backend_test.dart Fix flutter run on Mac x64 hosts if Swift Package Manager is enabled (#154645) 2024-09-11 20:03:22 +00:00
xcode_project_test.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00