Skip to content

On macOS Sequoia - [tool_crash] SocketException: Send failed, OS Error: No route to host, errno = 65 #150131

Closed

Description

@RafaelZasas

Workaround

Important

On macOS, open System Settings > Privacy & Security > Local Network. Toggle on the permission for all the code editors and terminals you use to launch Flutter apps. You might need to restart your code editor, terminal, and physical device.

Command

flutter run

Steps to Reproduce

Run flutter app on IOS 18 Beta

Logs

SocketException: Send failed, OS Error: No route to host, errno = 65

#0      _NativeSocket.send (dart:io-patch/socket_patch.dart:1269:34)
#1      _RawDatagramSocket.send (dart:io-patch/socket_patch.dart:2584:15)
#2      MDnsClient.lookup (package:multicast_dns/multicast_dns.dart:225:14)
#3      MDnsVmServiceDiscovery._pollingVmService (package:flutter_tools/src/mdns_discovery.dart:232:66)
<asynchronous suspension>
#4      MDnsVmServiceDiscovery.firstMatchingVmService (package:flutter_tools/src/mdns_discovery.dart:188:56)
<asynchronous suspension>
#5      MDnsVmServiceDiscovery.getVMServiceUriForLaunch (package:flutter_tools/src/mdns_discovery.dart:433:50)
<asynchronous suspension>
#6      Future.any.onValue (dart:async/future.dart:628:5)
<asynchronous suspension>
�[32m[✓]�[39m Flutter (Channel beta, 3.23.0-0.1.pre, on macOS 15.0 24A5264n darwin-arm64, locale en-US)
    �[32m•�[39m Flutter version 3.23.0-0.1.pre on channel beta at /Users/rafaelzasas/dev/flutter
    �[32m•�[39m Upstream repository https://github.com/flutter/flutter.git
    �[32m•�[39m Framework revision 2feea7a407 (7 days ago), 2024-06-06 10:19:10 +0700
    �[32m•�[39m Engine revision bb10c54666
    �[32m•�[39m Dart version 3.5.0 (build 3.5.0-180.3.beta)
    �[32m•�[39m DevTools version 2.36.0

�[32m[✓]�[39m Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    �[32m•�[39m Android SDK at /Users/rafaelzasas/Library/Android/sdk
    �[32m•�[39m Platform android-34, build-tools 34.0.0
    �[32m•�[39m Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    �[32m•�[39m Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    �[32m•�[39m All Android licenses accepted.

�[32m[✓]�[39m Xcode - develop for iOS and macOS (Xcode 15.4)
    �[32m•�[39m Xcode at /Applications/Xcode.app/Contents/Developer
    �[32m•�[39m Build 15F31d
    �[32m•�[39m CocoaPods version 1.15.2

�[32m[✓]�[39m Chrome - develop for the web
    �[32m•�[39m Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

�[32m[✓]�[39m Android Studio (version 2022.2)
    �[32m•�[39m Android Studio at /Applications/Android Studio.app/Contents
    �[32m•�[39m Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    �[32m•�[39m Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    �[32m•�[39m Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

�[32m[✓]�[39m VS Code (version 1.87.2)
    �[32m•�[39m VS Code at /Applications/Visual Studio Code.app/Contents
    �[32m•�[39m Flutter extension version 3.84.0

�[32m[✓]�[39m Connected device (5 available)
    �[32m•�[39m Rafs Iphone 15 (mobile)         • 00008130-001640DA0891401C • ios            • iOS 18.0 22A5282m
   

Activity

  1. darshankawar commented on Jun 13, 2024

    @darshankawar
    Member

    Run flutter app on IOS 18 Beta

    @RafaelZasas Do you get this error only on this newest iOS version or in previous iOS versions as well ?
    If you create a new flutter project and try to run the same command on iOS 18 beta, do you still see the same crash ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 13, 2024
  3. RafaelZasas commented on Jun 13, 2024

    @RafaelZasas
    Author

    It only happened with the beta. Unsure if it's due to the sequoia beta, ios beta or xcode beta.

    Ran a blank flutter project with no issues.

    Gave up on trying to run ios with the beta. Hot reload doesn't work.

    Android seems to work fine.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 13, 2024
  5. darshankawar commented on Jun 13, 2024

    @darshankawar
    Member

    Thanks for the update. Labeling this for team's attention, as this seems to be occuring on latest iOS 18 beta. There was another report with same crash using iOS 18.

    /cc @christopherfujino

  6. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Jun 13, 2024
  7. christopherfujino commented on Jun 13, 2024

    @christopherfujino
    Contributor
  8. jmagman commented on Jun 14, 2024

    @jmagman
    Member

    Hm, I wasn't able to reproduce this, I can flutter run and flutter attach to a device running iOS 18 beta 1.

  9. RafaelZasas commented on Jun 14, 2024

    @RafaelZasas
    Author

    Hm, I wasn't able to reproduce this, I can flutter run and flutter attach to a device running iOS 18 beta 1.

    I was also able to run without an issue on a brand new project.

    Keep in mind I'm also using beta Mac OS and beta x code.

    I think some issues were arising due to Firebase dependencies.

  10. jmagman commented on Jun 14, 2024

    @jmagman
    Member

    I'm not on the macOS beta yet, that may be why I can't repro.

  11. changed the title [-][tool_crash] SocketException: Send failed, OS Error: No route to host, errno = 65[/-] [+]On macOS Sequoia - [tool_crash] SocketException: Send failed, OS Error: No route to host, errno = 65[/+] on Jun 14, 2024
  12. 190 remaining items

  13. flutter-triage-bot commented on Dec 18, 2025

    @flutter-triage-bot

    This issue is assigned to @vashworth but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  14. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Dec 18, 2025
  15. aipinn commented on Feb 1, 2026

    @aipinn

    Subject: Found a reliable fix for "No route to host (errno 65)" on iOS

    I encountered the same SocketException: Connection failed (OS Error: No route to host, errno = 65) issue when connecting to a local backend IP (e.g., http://192.168.31.94:8000).

    Surprisingly, the browser could access the URL, but the Flutter App failed silently without any permission prompts.

    The Root Cause

    It appears to be a "silent block" by iOS Local Network Privacy. If you use a raw IP address, iOS sometimes fails to trigger the Local Network Permission dialog, leading to a direct No route to host error even if the device can ping the server.

    The Solution (How to fix it)

    The most reliable way to "wake up" the iOS permission system is to use mDNS (hostname.local) instead of a raw IP:

    Find your computer's local hostname (e.g., MyMac.local on macOS or your device name on Windows).

    Change your API base URL from http://192.168.x.x:8000 to http://MyMac.local:8000.

    Run the app again. iOS should now correctly trigger the "App would like to find and connect to devices on your local network" prompt.

    Once you grant permission, both the hostname and the raw IP will start working.

    Why this happens

    iOS treats mDNS (.local) as a discovery service which strictly requires the Local Network Permission. Using the hostname forces the system to evaluate the app's permissions, whereas using a raw IP might just get blocked by the sandbox if the permission state is "unknown" or "stale."

    Hope this helps anyone struggling with this "ghost" connection issue!

  16. flutter-triage-bot commented on Mar 5, 2026

    @flutter-triage-bot

    This issue was assigned to @vashworth but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  17. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Mar 5, 2026
  18. vashworth commented on Mar 19, 2026

    @vashworth
    Contributor

    I don't think there is any remaining work here. Is mDNS fails, it's non-fatal in most cases unless it's required and if it does fail, it gives a guided error message that tells you how to fix: #167135

    Closing.

  19. github-actions commented on Apr 2, 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.

  20. locked as resolved and limited conversation to collaborators on Apr 2, 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

    P1High-priority issues at the top of the work listc: crashStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.e: OS-version specificAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-macosOwned by the macOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions