Short answer
If it fails only in release on Android, add <uses-permission android:name="android.permission.INTERNET" /> to android/app/src/main/AndroidManifest.xml: Flutter’s debug manifest has it, the main one doesn’t. On macOS, add com.apple.security.network.client to both entitlements files. Otherwise check the host name, the device’s internet and DNS (try the URL in the device’s browser), and catch SocketException to show an offline message.
Why the lookup failed, and the fix
01
No INTERNET permission in the release manifest
“Android apps must declare their use of the internet in the Android manifest” Flutter, Networking
A new Flutter project adds the INTERNET permission only to the debug and profile manifests, so a release build or a Play Store install has no network. Add it to the main manifest, outside the application tag, then stop the app and run it again: hot reload and hot restart don’t pick up manifest changes.
<!-- android/app/src/main/AndroidManifest.xml --> <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.INTERNET" /> <application ...>02
A macOS app without the network entitlement
“macOS apps must allow network access in the relevant *.entitlements files.” Flutter, Networking
macOS apps are sandboxed. Add the network client key to macos/Runner/DebugProfile.entitlements and Release.entitlements; the debug file alone makes it fail only in release. Rebuild the app after the change.
<key>com.apple.security.network.client</key> <true/>03
The emulator or device has no working DNS
An Android emulator that lost its network after the computer changed Wi-Fi or VPN can’t resolve any name. Open a website in the emulator’s browser. If it fails too, cold boot the emulator, start it with a public DNS server (emulator -avd NAME -dns-server 8.8.8.8), or wipe its data; on a phone, switch networks or turn off a VPN or Private DNS setting that blocks the host.
04
A wrong host name, or an app that assumes it is online
“Exception thrown when a socket operation fails.” Dart, SocketException class
A typo in the host name, or a base URL built from the wrong environment variable, fails the lookup. (An empty URL or http://localhost gives a different error; see the FAQ.) Log the full URL before the request. Real users go offline too, so catch SocketException and show a retry message instead of a crash.
try { final res = await http.get(Uri.parse('$baseUrl/orders')); } on SocketException catch (e) { // e.message: Failed host lookup showOfflineBanner(); }
Checked against the vendor’s docs on : Flutter: Networking (Android permission, macOS entitlement); Android Developers: Connect to the network (INTERNET permission); Dart API: SocketException class.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: Flutter HandshakeException CERTIFICATE_VERIFY_FAILED · Android cleartext HTTP blocked · Flutter web “XMLHttpRequest error” · Flutter “version solving failed”