Repository navigation
Flutter: Launch emulator - invalid entries #5052
Copy link
Copy link
Closed
Labels
Milestone
Description
Describe the bug
When I open "Flutter: Launch emulator" I see two options that cannot be selected - why are they there and how can I remove them?
To Reproduce
Steps to reproduce the behavior:
- Shift Command P (Mac)
- Type "Flutter: Launch emulator"
- Hit return
Expected behavior
Display a list of emulators that can be launched.
Screenshots
Workspace Environment
Dart Code extension: 3.84.0
Flutter extension: 3.84.0 (activated)
App: Visual Studio Code
App Host: desktop
Version: mac 1.87.2
Workspace type: Flutter (LSP)
Dart (3.0.0): /Users/rhisiart/fvm/versions/3.10.0/bin/cache/dart-sdk
Flutter (3.10.0): /Users/rhisiart/fvm/versions/3.10.0 (No device)
Output from 'dart info'
/Users/rhisiart/fvm/versions/3.10.0/bin/cache/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
- Dart 3.0.0 (stable) (Thu May 4 01:11:00 2023 -0700) on "macos_arm64"
- on macos / Version 14.4.1 (Build 23E224)
- locale is en-GB
Project info
- sdk constraint: '>=2.19.0 <3.0.0'
- dependencies: app_tracking_transparency, bloc, cloud_firestore, dio, firebase_auth, firebase_core, firebase_crashlytics, firebase_ui_firestore, flow_builder, flutter, flutter_background_geolocation, flutter_bloc, flutter_form_builder, flutter_localizations, flutter_native_splash, flutter_shake_animated, flutterfire_ui, form_builder_validators, freezed_annotation, google_fonts, google_maps_flutter, http_mock_adapter, iconify_flutter, intl, json_annotation, json_serializable, package_info_plus, permission_handler, platform_device_id, shared_preferences, xml
- dev_dependencies: bloc_test, build_runner, collection, dart_code_metrics, fake_cloud_firestore, flutter_launcher_icons, flutter_test, freezed, mocktail, very_good_analysis
- elided dependencies: 1
Process info
| Memory | CPU | Elapsed time | Command line |
|---|---|---|---|
| 10 MB | 0.0% | 03:30:45 | dart devtools --machine --allow-embedding |
| 783 MB | 0.0% | 03:30:45 | dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.84.0 |
| 43 MB | 0.7% | 03:30:45 | flutter_tools.snapshot daemon |
Output from 'flutter doctor'
/Users/rhisiart/fvm/versions/3.10.0/bin/flutter doctor -v
[✓] Flutter (Channel stable, 3.10.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-GB)
• Flutter version 3.10.0 on channel stable at /Users/rhisiart/fvm/versions/3.10.0
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (11 months ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/rhisiart/Library/android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_SDK_ROOT = /Users/rhisiart/Library/android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode-15.2.0.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2)
• Android Studio at /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 17.0.9+0-17.0.9b1087.7-11185874)
[✓] VS Code (version 1.87.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.84.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87
[✓] Network resources
• All expected network resources are available.
• No issues found!
Reactions are currently unavailable

Activity
DanTup commentedon Apr 2, 2024
Very odd - do these show up if you run
flutter emulators?If not, can you enable the Flutter Daemon log and restart VS Code, reproduce the issue, then provide the log file? Thanks!
xni06 commentedon Apr 2, 2024
DanTup commentedon Apr 2, 2024
Do you see the same if you run
emulatorfrom the Android SDK directly?You can find your SDK path by running
flutter config --machineif you don't know it.emulatorwon't have a.exeif you're not on Windows, and it might be in theemulatorfolder or thetoolfolder.My guess is that something is failing in this command in the SDK, and when Flutter is scraping the output for emulators it just reads the error as if it is an emulator (in which case the fix is probably in Flutter to skip over the lines that seem like errors in the output?).
xni06 commentedon Apr 2, 2024
√ ags % flutter config --machine { "android-studio-dir": "/Applications/Android Studio.app", "android-sdk": "/Users/rhisiart/Library/android/sdk" } √ ags % /Users/rhisiart/Library/android/sdk/tools/emulator -list-avds Pixel_8_Pro_API_33DanTup commentedon Apr 2, 2024
hmm, well that's a little odd!
Could you file an issue at https://github.com/flutter/flutter/ and include both your outputs from above (running
emulator -list-avdsdirectly, andflutter emulators).It's also worth seeing whether running
/Users/rhisiart/Library/android/sdk/emulator/emulator -list-avdsis any different (since I seem to have two copies ofemulatorinemulator/andtools/and Flutter seems to check for both).xni06 commentedon Apr 2, 2024
DanTup commentedon Apr 2, 2024
Ah, that's interesting. Apparently the
emulatorone is new, so the new one is writing errors and the old one is not.Please include the output of all three things in an issue in flutter/flutter. Probably a reasonable fix would be to ignore the lines that contain
|as it seems like they're not going to be emulator names.There's another question about what's crashing and why, but that's probably a question/bug for the Android SDK rather than Dart/Flutter.
Thanks!
xni06 commentedon Apr 2, 2024
Thanks @DanTup
flutter/flutter#146125
DanTup commentedon Apr 18, 2024
I'm filtering these bogus items out client-side until a fix ships in Flutter (and for SDKs prior to that fix).
DanTup commentedon Apr 18, 2024
What are the chances that I add a filter today and then I managed to reproduce this:
😄