Skip to content

Failed to start dart tooling daemon when local machine does not have 127.0.0.1 loopback IP address #151375

Closed

Description

@firassolt

Steps to reproduce

Just running any app in VSCODE

Actual results

The app fails to run at all, trying to build on both android and the iOS simulator

Logs

Logs
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/tools
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/tools -> /Users/firassoltani/Library/Android/sdk/tools/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator -> /Users/firassoltani/Library/Android/sdk/emulator/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/tools/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator -> /Users/firassoltani/Library/Android/sdk/emulator/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/tools
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/tools -> /Users/firassoltani/Library/Android/sdk/tools/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator
[6:52:46 PM] [General] [Info]         /Users/firassoltani/Library/Android/sdk/emulator -> /Users/firassoltani/Library/Android/sdk/emulator/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/opt/openjdk/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.8/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Python.framework/Versions/3.10/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/bin
[6:52:46 PM] [General] [Info]         /opt/homebrew/sbin
[6:52:46 PM] [General] [Info]         /usr/local/bin
[6:52:46 PM] [General] [Info]         /usr/bin
[6:52:46 PM] [General] [Info]         /bin
[6:52:46 PM] [General] [Info]         /usr/sbin
[6:52:46 PM] [General] [Info]         /sbin
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker
[6:52:46 PM] [General] [Info]         /Applications/Docker.app/Contents/Resources/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker/bin
[6:52:46 PM] [General] [Info]         /Library/Apple/usr/bin
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands
[6:52:46 PM] [General] [Info]         /Library/Frameworks/Mono.framework/Versions/Current/Commands -> /Library/Frameworks/Mono.framework/Versions/Current/Commands/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/.spicetify
[6:52:46 PM] [General] [Info]         /Users/firassoltani/.spicetify -> /Users/firassoltani/.spicetify/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk -> /Users/firassoltani/flutter/bin/cache/dart-sdk/bin
[6:52:46 PM] [General] [Info]     Found at:
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk -> /Users/firassoltani/flutter/bin/cache/dart-sdk/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk -> /Users/firassoltani/flutter/bin/cache/dart-sdk/bin
[6:52:46 PM] [General] [Info]     Candidate paths to be post-filtered:
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin -> /Users/firassoltani/flutter
[6:52:46 PM] [General] [Info]         /Users/firassoltani/flutter/bin/cache/dart-sdk
[6:52:46 PM] [General] [Info]     Found at /Users/firassoltani/flutter/bin/cache/dart-sdk
[6:52:46 PM] [General] [Info]     Returning SDK path /Users/firassoltani/flutter/bin/cache/dart-sdk for dart
[6:52:46 PM] [General] [Info] Experiment random number is 47 for experiment 'sdkDaps'. Experiment is enabled for <= 100
[6:52:46 PM] [General] [Info] Experiment 'sdkDaps' is activating (not first time)
[6:52:46 PM] [General] [Info] Experiment random number is 47 for experiment 'sdkDaps'. Experiment is enabled for <= 100
[6:52:46 PM] [General] [Info] Experiment 'sdkDaps' is activating (not first time)
[6:52:46 PM] [General] [Info] Experiment random number is 47 for experiment 'sdkDaps'. Experiment is enabled for <= 10
[6:52:46 PM] [General] [Info] Experiment 'sdkDaps' does not apply and will not be activated
[6:52:46 PM] [General] [Info] !! ⚠️ PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING ⚠️ !!
Dart Code extension: 3.92.0
Flutter extension: 3.92.0 (not activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.91.0

Workspace type: Flutter (LSP)

Dart (3.4.3): /Users/firassoltani/flutter/bin/cache/dart-sdk
Flutter (3.22.2): /Users/firassoltani/flutter (No device)
[6:52:46 PM] [DartToolingDaemon] [Info] Spawning /Users/firassoltani/flutter/bin/cache/dart-sdk/bin/dart with args ["tooling-daemon","--machine"]
[6:52:46 PM] [DartToolingDaemon] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"/Users/firassoltani/flutter"}}
[6:52:46 PM] [DartToolingDaemon] [Info]     PID: 79457
[6:52:46 PM] [FlutterDaemon] [Info] Spawning /Users/firassoltani/flutter/bin/flutter with args ["daemon"]
[6:52:46 PM] [FlutterDaemon] [Info] ..  in /Users/firassoltani/flutter
[6:52:46 PM] [FlutterDaemon] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"/Users/firassoltani/flutter"}}
[6:52:46 PM] [FlutterDaemon] [Info]     PID: 79457
[6:52:46 PM] [General] [Info] Returning cached results for project search
[6:52:46 PM] [General] [Info] Checking 1 projects for supported platforms
[6:52:46 PM] [Analyzer] [Info] Spawning /Users/firassoltani/flutter/bin/cache/dart-sdk/bin/dart with args ["language-server","--protocol=lsp","--client-id=VS-Code","--client-version=3.92.0"]
[6:52:46 PM] [Analyzer] [Info]     PID: 79461
[6:52:46 PM] [General] [Info] Returning cached results for project search
[6:52:46 PM] [General] [Info] Activating Flutter extension for Flutter project...
[6:52:46 PM] [General] [Info] Version last used for Pub is 3.4.3 (3.4.0), current is 3.4.3 (3.4.0)
[6:52:46 PM] [General] [Info] Found 0 folders requiring "pub get" or "pub upgrade":
[6:52:46 PM] [Analyzer] [Info] ==> Content-Length: 6465
[6:52:46 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":79457,"clientInfo":{"name":"Visual Studio Code","version":"1.91.0"},"locale":"en","rootPath":"/Users/firassoltani/bmoovd_","rootUri":"file:///Users/firassoltani/bmoovd_","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"…
[6:52:47 PM] [General] [Info] Loaded 20000 package names from vscode-userdata:/Users/firassoltani/Library/Application%20Support/Code/User/globalStorage/dart-code.dart-code/package_cache.json
[6:52:47 PM] [General] [Info] !! ⚠️ PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING ⚠️ !!
Dart Code extension: 3.92.0
Flutter extension: 3.92.0 (activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.91.0

Workspace type: Flutter (LSP)

Dart (3.4.3): /Users/firassoltani/flutter/bin/cache/dart-sdk
Flutter (3.22.2): /Users/firassoltani/flutter (No device)
[6:52:47 PM] [DartToolingDaemon] [Error] [DartDevelopmentServiceException: Failed to create server socket (Can't assign requested address): 127.0.0.1:0, #0      DartToolingDaemon._startService (package:dtd_impl/dart_tooling_daemon.dart:149:7)
<asynchronous suspension>
#1      DartToolingDaemon.startService (package:dtd_impl/dart_tooling_daemon.dart:192:5)
<asynchronous suspension>
#2      main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/dtd_impl/bin/dtd.dart:16:3)
<asynchronous suspension>
]
[6:52:47 PM] [FlutterDaemon] [Info] <== [{"event":"daemon.connected","params":{"version":"0.6.1","pid":79460}}]
[6:52:47 PM] [FlutterDaemon] [Info] ==> [{"id":"1","method":"device.enable"}]
[6:52:47 PM] [FlutterDaemon] [Info] ==> [{"id":"2","method":"emulator.getEmulators"}]
[6:52:47 PM] [FlutterDaemon] [Info] ==> [{"id":"3","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"/Users/firassoltani/bmoovd_"}}]
[6:52:47 PM] [DartToolingDaemon] [Info] Process /Users/firassoltani/flutter/bin/cache/dart-sdk/bin/dart terminated! 255, null
[6:52:47 PM] [DartToolingDaemon] [Info] DTD connection closed

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 13.2 22D49 darwin-arm64 (Rosetta),
    locale en-TN)
[✓] Android toolchain - develop for Android devices (Android SDK version
    35.0.0-rc3)
[!] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    ! Flutter recommends a minimum Xcode version of 15.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.91.0)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Activity

  1. erkinovalim commented on Jul 7, 2024

    @erkinovalim

    It seems like this is the problem

    [Error] [DartDevelopmentServiceException: Failed to create server socket (Can't assign requested address)

    Try this solution: https://stackoverflow.com/a/61503234/22343394

  2. added
    in triagePresently being triaged by the triage team
    on Jul 8, 2024
  3. huycozy commented on Jul 8, 2024

    @huycozy
    Member

    @firassolt Does this issue only occur on VSCode? Can you try running project on Terminal or Android Studio?

    If the issue only appears on VSCode, please check Dart-Code/Dart-Code#4656 (comment) to see if it helps.

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 8, 2024
  5. firassolt commented on Jul 14, 2024

    @firassolt
    Author

    Nothing you guys suggested solved the issue, it persisted

  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 14, 2024
  7. huycozy commented on Jul 15, 2024

    @huycozy
    Member

    The app fails to run at all, trying to build on both android and the iOS simulator

    What kind of simulator/emulator are you using? Is it Genymotion simulator? (related issue #81046) Please provide the output of flutter doctor -v.

    Does this issue only occur on VSCode? Can you try running project on Terminal or Android Studio?

    Can you confirm this as well?

    [6:52:47 PM] [DartToolingDaemon] [Error] [DartDevelopmentServiceException: Failed to create server socket (Can't assign requested address): 127.0.0.1:0, #0 DartToolingDaemon._startService (package:dtd_impl/dart_tooling_daemon.dart:149:7)

    For this error, it seems to be an OSError, it's thrown here I think: /flutter_master/bin/cache/dart-sdk/lib/_internal/vm/bin/socket_patch.dart

    var result;
    if (address.type == InternetAddressType.unix) {
      var path = address.address;
      if (FileSystemEntity.isLinkSync(path)) {
        path = Link(path).targetSync();
      }
      result = socket.nativeCreateUnixDomainBindListen(
          path, backlog, shared, _Namespace._namespace);
    } else {
      result = socket.nativeCreateBindListen(
          address._in_addr, port, backlog, v6Only, shared, address._scope_id);
    }
    if (result is OSError) {
      throw new SocketException("Failed to create server socket",
          osError: result, address: address, port: port);
    }
  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 15, 2024
  9. firassolt commented on Jul 15, 2024

    @firassolt
    Author

    This is the flutter do tor output, and I'm using the iOS Simulator.
    Running the project from the terminal works but I'm not able to reload or do anything.

    [✓] Flutter (Channel stable, 3.22.2, on macOS 13.2 22D49 darwin-arm64 (Rosetta),
        locale en-TN)
        • Flutter version 3.22.2 on channel stable at
          /Users/firassoltani/Downloads/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 761747bfc5 (6 weeks ago), 2024-06-05 22:15:13 +0200
        • Engine revision edd8546116
        • Dart version 3.4.3
        • DevTools version 2.34.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version
        35.0.0-rc3)
        • Android SDK at /Users/firassoltani/Library/Android/sdk
        • Platform android-34, build-tools 35.0.0-rc3
        • ANDROID_HOME = /Users/firassoltani/Library/Android/sdk
        • ANDROID_SDK_ROOT = /Users/firassoltani/Library/Android/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          11.0.15+0-b2043.56-8887301)
        • All Android licenses accepted.
    
    [!] Xcode - develop for iOS and macOS (Xcode 14.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14E300c
        ! Flutter recommends a minimum Xcode version of 15.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.1)
        • 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
          11.0.15+0-b2043.56-8887301)
    
    [✓] VS Code (version 1.91.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.58.0
    
    [✓] Connected device (3 available)            
        • macOS (desktop)                 • macos                 • darwin-arm64   •
          macOS 13.2 22D49 darwin-arm64 (Rosetta)
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         •
          macOS 13.2 22D49 darwin-arm64 (Rosetta)
        • Chrome (web)                    • chrome                • web-javascript •
          Google Chrome 126.0.6478.127
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 15, 2024
  11. huycozy commented on Jul 15, 2024

    @huycozy
    Member

    Thanks for the update. I can't reproduce this on my end but will label this for other's input.

    Kindly cc: @DanTup for inputs on VSCode side.

  12. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Jul 15, 2024
  13. 10 remaining items

  14. bkonyi commented on Jul 19, 2024

    @bkonyi
    Contributor

    Actually, it looks like you have two Flutter installations: one at /Users/firassoltani/flutter/ (based on the VSCode output) and one at /Users/firassoltani/Downloads/flutter (based on your flutter doctor output). Is this expected?

  15. bkonyi commented on Jul 19, 2024

    @bkonyi
    Contributor

    One last request: can you also share the output of ifconfig lo0? I suspect this might be a network configuration issue on your machine if we're failing to bind to 127.0.0.1.

  16. firassolt commented on Jul 20, 2024

    @firassolt
    Author

    I resolved the dual installation issue, but it's still the same

    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    inet 192.168.1.88 netmask 0xffffffff
    nd6 options=201<PERFORMNUD,DAD>

  17. DanTup commented on Jul 22, 2024

    @DanTup
    Contributor

    @firassolt

    Could not find a command named "tooling-daemon".

    Is it possible you just ran dart tooling-daemon instead of /Users/firassoltani/flutter/bin/cache/dart-sdk/bin/dart tooling-daemon and it used your other version of Flutter (from PATH)? In the log you posted above, the daemon command did work for that version of Dart, so this error looks like you were using an older SDK.

    I'm not familiar with the output of ifconfig so I'll let @bkonyi comment on that, but I'll note that if I run ifconfig lo in a WSL terminal (I'm on Windows), I see an explicit entry for 127.0.0.1 which you don't have:

    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 32  bytes 3338 (3.3 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 32  bytes 3338 (3.3 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    This makes me wonder what you get if you ping 127.0.0.1 and nslookup localhost? I would've thought more things wouldn't work if you didn't have the IPv4 loopback address, but maybe other tools are just using localhost and using IPv6.

  18. firassolt commented on Jul 22, 2024

    @firassolt
    Author

    I fixed it by doing :
    sudo ifconfig lo0 alias 127.0.0.1 up

    And then taking the lo0 down and up
    Then it worked again.

  19. DanTup commented on Jul 22, 2024

    @DanTup
    Contributor

    Great, glad it's sorted!

    I've also just landed a fix to the VS Code extension so that if DTD fails to start, it doesn't prevent other functionality that doesn't rely on DTD (like launching a Flutter app) from working.

    I don't suppose you have any thoughts about why you didn't already have this IP?

    @bkonyi do you think there's value in trying to handle this in DTD differently? Or @andrewkolos a doctor check in the tool that the loopback address exists? (I don't know how uncommon this issue is likely to be). Otherwise, probably this can be closed.

  20. bkonyi commented on Jul 22, 2024

    @bkonyi
    Contributor

    @bkonyi do you think there's value in trying to handle this in DTD differently? Or @andrewkolos a doctor check in the tool that the loopback address exists? (I don't know how uncommon this issue is likely to be). Otherwise, probably this can be closed.

    We do have a --ipv6 flag for dart tooling-daemon that could be used to attempt to start the daemon using the IPv6 loopback. Maybe the IDE could attempt to restart DTD with that flag?

    I have seen a few issues on StackOverflow related to the IPv4 loopback address not being configured, so this isn't a totally unheard of problem for users to encounter.

  21. DanTup commented on Jul 23, 2024

    @DanTup
    Contributor

    We do have a --ipv6 flag for dart tooling-daemon that could be used to attempt to start the daemon using the IPv6 loopback. Maybe the IDE could attempt to restart DTD with that flag?

    Would it be better to do this within DTD (possibly with flags to avoid it if there's a reason we wouldn't always want this behaviour)? That way all IDEs and CLI would get this from one implementation instead of IDEs needing to each implement it and CLI users having to manually re-run with that flag?

  22. changed the title [-]Failed to start dart tooling daemon[/-] [+]Failed to start dart tooling daemon when local machine does not have 127.0.0.1 loopback IP address[/+] on Jul 23, 2024
  23. firassolt commented on Jul 23, 2024

    @firassolt
    Author

    Something about this, is that I tried with Chatgpt and the first solution it gave me was to try and set a host/port when running the app.
    Since reload functionality and hot restart weren't working because of the DTD not starting, and the apps just wouldn't load.
    There was no proper way to set a host/port for the DTD to start with.

    @DanTup I have no idea, honestly, I never noticed that it wasn't in the loopback.

  24. a-siva commented on Jul 24, 2024

    @a-siva
    Contributor

    I am going to file an issue against DTD based on the comment from @DanTup above comment-2244670587 and close this issue as fixed.

  25. a-siva commented on Jul 26, 2024

    @a-siva
    Contributor

    Created dart-lang/sdk#56324 to track issue against DTD.
    Closing this issue.

  26. github-actions commented on Aug 9, 2024

    @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.

  27. locked as resolved and limited conversation to collaborators on Aug 9, 2024
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 listc: crashStack traces logged to the consoledependency: dartDart team may need to help usteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions