Repository navigation
On macOS Sequoia - [tool_crash] SocketException: Send failed, OS Error: No route to host, errno = 65 #150131
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.e: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-macosOwned by the macOS platform teamOwned by the macOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
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 runSteps 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.e: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-macosOwned by the macOS platform teamOwned by the macOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Type
Projects
- StatusShow more project fieldsDone
Activity
darshankawar commentedon Jun 13, 2024
@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 ?
RafaelZasas commentedon Jun 13, 2024
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.
darshankawar commentedon Jun 13, 2024
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
christopherfujino commentedon Jun 13, 2024
FYI @jmagman
jmagman commentedon Jun 14, 2024
Hm, I wasn't able to reproduce this, I can
flutter runandflutter attachto a device running iOS 18 beta 1.RafaelZasas commentedon Jun 14, 2024
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.
jmagman commentedon Jun 14, 2024
I'm not on the macOS beta yet, that may be why I can't repro.
[-][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[/+]190 remaining items
flutter-triage-bot commentedon Dec 18, 2025
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!
aipinn commentedon Feb 1, 2026
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!
flutter-triage-bot commentedon Mar 5, 2026
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.
vashworth commentedon Mar 19, 2026
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.
github-actions commentedon Apr 2, 2026
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 -vand a minimal reproduction of the issue.