Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[tool_crash] StateError: Bad state: Stream has already been listened to. #176736

@gspencergoog

Description

@gspencergoog

Command

flutter run --machine --print-dtd

Steps to Reproduce

  1. Create a counter app with flutter create counter
  2. cd counter
  3. flutter run --machine
  4. Select linux
  5. Boom!

Note that this doesn't fail if you specify -d linux on the command line.

Logs

StateError: Bad state: Stream has already been listened to.

#0      _StreamController._subscribe (dart:async/stream_controller.dart:695:7)
#1      _ControllerStream._createSubscription (dart:async/stream_controller.dart:854:20)
#2      _StreamImpl.listen (dart:async/stream_impl.dart:516:42)
#3      _Socket.listen (dart:io-patch/socket_patch.dart:2727:31)
#4      _StdStream.listen (dart:io/stdio.dart:26:20)
#5      new DaemonInputStreamConverter.<anonymous closure> (package:flutter_tools/src/daemon.dart:64:70)
#6      _runGuarded (dart:async/stream_controller.dart:838:24)
#7      _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:716:7)
#8      _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:457:13)
#9      _StreamController._subscribe (dart:async/stream_controller.dart:715:18)
#10     _ControllerStream._createSubscription (dart:async/stream_controller.dart:854:20)
#11     _StreamImpl.listen (dart:async/stream_impl.dart:516:42)
#12     new DaemonConnection (package:flutter_tools/src/daemon.dart:247:54)
#13     new Daemon.createMachineDaemon (package:flutter_tools/src/commands/daemon.dart:200
flutter --version
Flutter 3.37.0-1.0.pre-440 • channel main • [email protected]:flutter/flutter.git
Framework • revision e20c5f5594 (2 days ago) • 2025-10-07 03:47:40 -0400
Engine • hash 9fe6c19aa999b3803929620bb70253d2a4367e8e (revision e20c5f5594) (35 hours ago) • 2025-10-07 07:47:40.000Z
Tools • Dart 3.10.0 (build 3.10.0-287.0.dev) • DevTools 2.50.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions