Skip to content

flutter drive Impeller startup crashes appear as VM HTTP exceptions #162087

Closed

Description

@matanlurey

Reproduction:

  1. Start an Android 34 emulator
  2. Use the following AndroidManifest.xml to force vulkan (i.e. no fallback logic), though other crashes might also cause this
  3. Try running the app with flutter drive lib/main.dart

You'll get something like:

$ flutter drive lib/main.dart
It is taking an unusually long time to connect to the VM...
Oops; flutter has exited unexpectedly: "HttpException: Connection closed before full header was received

There are two bugs:

  1. We are missing information on why we can't connect (more on that in a second)
  2. The crash has nothing to do with the VM service or HTTP

If you flutter run lib/main.dart (i.e. the same code, just with flutter run):

$ flutter run lib/main.dart
E/flutter ( 5377): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(285)] Break on 'ImpellerValidationBreak' to inspect point of failure: Device does not support required Android extension: VK_KHR_external_semaphore_fd
E/flutter ( 5377): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(310)] Break on 'ImpellerValidationBreak' to inspect point of failure: Device not suitable since required extensions are not supported.
E/flutter ( 5377): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(393)] Break on 'ImpellerValidationBreak' to inspect point of failure: Device doesn't support the required queues.
E/flutter ( 5377): [ERROR:flutter/impeller/renderer/backend/vulkan/context_vk.cc(278)] Break on 'ImpellerValidationBreak' to inspect point of failure: No valid Vulkan device found.
I/flutter ( 5377): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(60)] Using the Impeller rendering backend (Vulkan).
F/flutter ( 5377): [FATAL:flutter/shell/platform/android/platform_view_android.cc(127)] Check failed: android_context_->IsValid(). Could not create surface from invalid Android context.
Error connecting to the service protocol: failed to connect to http://127.0.0.1:58976/_qg3X7xW8FA=/ DartDevelopmentServiceException: WebSocketChannelException:
HttpException: Connection closed before full header was received, uri = http://127.0.0.1:58976/_qg3X7xW8FA=/ws

Better, at least we get the error messages (I'd expect to see these in flutter drive, but do not).

Activity

  1. added
    f: integration_testThe flutter/packages/integration_test plugin
    fyi-androidFor the attention of Android platform team
    fyi-engineFor the attention of Engine team
    P1High-priority issues at the top of the work list
    platform-androidAndroid applications specifically
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    team-toolOwned by Flutter Tool team
    on Jan 23, 2025
  2. self-assigned this
    on Jan 23, 2025
  3. matanlurey commented on Jan 24, 2025

    @matanlurey
    ContributorAuthor

    The error is hidden in the following snippet:

    diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart
    index 694e1953ef..4b24f36f39 100644
    --- a/packages/flutter_tools/lib/src/android/android_device.dart
    +++ b/packages/flutter_tools/lib/src/android/android_device.dart
    @@ -698,6 +698,7 @@ class AndroidDevice extends Device {
           builtPackage.launchActivity,
         ];
         final String result = (await runAdbCheckedAsync(cmd)).stdout;
    +    print('>>> (await runAdbCheckedAsync(cmd)).stdout: $result');
         // This invocation returns 0 even when it fails.
         if (result.contains('Error: ')) {
           _logger.printError(result.trim(), wrap: false);

    For example, this would output:

    >>> (await runAdbCheckedAsync(cmd)).stdout: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x20000000 cmp=com.example.android_engine_test/.MainActivity (has extras) }
    
    An error occurred when setting up filtering for adb logs. Unable to communicate with the VM service.
    E/flutter ( 4754): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(285)] Break on 'ImpellerValidationBreak' to inspect point
    of failure: Device does not support required Android extension: VK_KHR_external_semaphore_fd
    E/flutter ( 4754): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(310)] Break on 'ImpellerValidationBreak' to inspect point
    of failure: Device not suitable since required extensions are not supported.
    E/flutter ( 4754): [ERROR:flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc(393)] Break on 'ImpellerValidationBreak' to inspect point
    of failure: Device doesn't support the required queues.
    E/flutter ( 4754): [ERROR:flutter/impeller/renderer/backend/vulkan/context_vk.cc(278)] Break on 'ImpellerValidationBreak' to inspect point of
    failure: No valid Vulkan device found.
    I/flutter ( 4754): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(60)] Using the Impeller rendering backend (Vulkan).
    F/flutter ( 4754): [FATAL:flutter/shell/platform/android/platform_view_android.cc(127)] Check failed: android_context_->IsValid(). Could not
    create surface from invalid Android context.
  4. matanlurey commented on Jan 24, 2025

    @matanlurey
    ContributorAuthor

    Unfortunately it's not always available, I'm guessing sometimes logcat is required to read these logs.

  5. jonahwilliams commented on Jan 27, 2025

    @jonahwilliams
    Contributor

    Talked about this a bit in triage and we're not sure that there is a better way than what we're doing now. :(

  6. matanlurey commented on Jan 27, 2025

    @matanlurey
    ContributorAuthor

    I am marking this as blocked and downgrading due to more systemic issues.

  7. 1 remaining item

  8. added
    P2Important issues not at the top of the work list
    on Jan 27, 2025
  9. removed their assignment
    on Jan 29, 2025
  10. added
    team-androidOwned by Android platform team
    triaged-androidTriaged by Android platform team
    and removed
    team-toolOwned by Flutter Tool team
    on Feb 11, 2025
  11. Checkerbeule commented on Dec 18, 2025

    @Checkerbeule

    Additional details / same or similar issue on my device

    I’m seeing the same (or very similar) behavior on a Pixel 2 XL running Android 15 (LineageOS 22.2).

    • The failure does not happen immediately
    • It occurs after ~2–3 minutes, while VS Code is still showing Gradle task assemble…
    • The app installs and launches, but the VM service / WebSocket connection drops after a couple of minutes.
    • Affected modes: debug and profile
    • --no-enable-impeller does not change the behavior

    Error message:

    failed to connect to http://127.0.0.1:XXXXX
    HttpException: Connection closed before full header was received

  12. added a commit that references this issue on May 14, 2026
  13. added a commit that references this issue on May 27, 2026
    2f61174
  14. added a commit that references this issue on Jul 23, 2026
    c72bd32
  15. github-actions commented on Aug 6, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  16. locked as resolved and limited conversation to collaborators on Aug 6, 2026
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

    P2Important issues not at the top of the work listblockedIssue is blocked by another issuef: integration_testThe flutter/packages/integration_test pluginplatform-androidAndroid applications specificallyt: flutter driver"flutter driver", flutter_drive, or a driver testteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions