Skip to content

Flutter: Launch emulator - invalid entries #5052

Closed

Description

@xni06

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:

  1. Shift Command P (Mac)
  2. Type "Flutter: Launch emulator"
  3. Hit return

Expected behavior
Display a list of emulators that can be launched.

Screenshots

Screenshot 2024-03-31 at 14 26 07

Screenshot 2024-03-31 at 14 35 54
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!

Activity

  1. DanTup commented on Apr 2, 2024

    @DanTup
    Member

    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!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Apr 2, 2024
  3. xni06 commented on Apr 2, 2024

    @xni06
    Author

    Very odd - do these show up if you run flutter emulators?

    √ ags % flutter emulators
    3 available emulators:
    
    apple_ios_simulator                                                                                                 • iOS Simulator
    • Apple  • ios
    INFO    | Storing crashdata in: /tmp/android-rhisiart/emu-crash-34.1.19.db, detection is enabled for process: 88721 • INFO    | Storing crashdata in:
    /tmp/android-rhisiart/emu-crash-34.1.19.db, detection is enabled for process: 88721 •        • android
    Pixel_8_Pro_API_33                                                                                                  • Pixel 8 Pro API 33
    • Google • android
    
    To run an emulator, run 'flutter emulators --launch <emulator id>'.
    To create a new emulator, run 'flutter emulators --create [--name xyz]'.
    
    You can find more information on managing emulators at the links below:
      https://developer.android.com/studio/run/managing-avds
      https://developer.android.com/studio/command-line/avdmanager
  4. DanTup commented on Apr 2, 2024

    @DanTup
    Member

    Do you see the same if you run emulator from the Android SDK directly?

    C:\Users\danny\AppData\Local\Android\sdk\tools\emulator.exe -list-avds
    

    You can find your SDK path by running flutter config --machine if you don't know it. emulator won't have a .exe if you're not on Windows, and it might be in the emulator folder or the tool folder.

    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?).

  5. xni06 commented on Apr 2, 2024

    @xni06
    Author
    √ 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_33
  6. DanTup commented on Apr 2, 2024

    @DanTup
    Member

    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-avds directly, and flutter emulators).

    It's also worth seeing whether running /Users/rhisiart/Library/android/sdk/emulator/emulator -list-avds is any different (since I seem to have two copies of emulator in emulator/ and tools/ and Flutter seems to check for both).

  7. xni06 commented on Apr 2, 2024

    @xni06
    Author
    √ ~ % /Users/rhisiart/Library/android/sdk/tools/emulator -list-avds 
    Pixel_8_Pro_API_33
    
    √ ~ % /Users/rhisiart/Library/android/sdk/emulator/emulator -list-avds
    INFO    | Storing crashdata in: /tmp/android-rhisiart/emu-crash-34.1.19.db, detection is enabled for process: 95538
    WARNING | Crash annotation is very large (16415), only 16384 bytes will be recorded, 31 bytes are lost.
    Pixel_8_Pro_API_33
  8. DanTup commented on Apr 2, 2024

    @DanTup
    Member

    Ah, that's interesting. Apparently the emulator one 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!

  9. xni06 commented on Apr 2, 2024

    @xni06
    Author
  10. added this to the v3.88.0 milestone on Apr 2, 2024
  11. added and removed
    awaiting infoRequires more information from the customer to progress
    on Apr 2, 2024
  12. DanTup commented on Apr 18, 2024

    @DanTup
    Member

    I'm filtering these bogus items out client-side until a fix ships in Flutter (and for SDKs prior to that fix).

  13. added
    in flutterRelates to running Flutter apps
    and removed on Apr 18, 2024
  14. DanTup commented on Apr 18, 2024

    @DanTup
    Member

    What are the chances that I add a filter today and then I managed to reproduce this:

    image

    😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions