iosflutterapple-appclips

Flutter App Clip cannot make api requests


DioException [connection error]: The connection errored: Connection failed flutter: β”‚ πŸ› Error: SocketException: Connection failed (OS Error: No route to host, errno = 65)

The error only occurs when building App Clip on real device, There is no such problem on simulator with the App Clip

Tested Devices:
[βœ“] Flutter (Channel stable, 3.13.0, on macOS 13.5.2 22G91 darwin-arm64, locale en-TR)
    β€’ Flutter version 3.13.0 on channel stable at /Users/alisinancobani/development/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision efbf63d9c6 (6 weeks ago), 2023-08-15 21:05:06 -0500
    β€’ Engine revision 1ac611c64e
    β€’ Dart version 3.1.0
    β€’ DevTools version 2.25.0

[βœ“] Xcode - develop for iOS and macOS (Xcode 15.0)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 15A240d
    β€’ CocoaPods version 1.12.1

[βœ“] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    β€’ IntelliJ at /Users/alisinancobani/Applications/IntelliJ IDEA Ultimate.app
    β€’ Flutter plugin version 75.1.4
    β€’ Dart plugin version 232.9559.10

[βœ“] Connected device (4 available)
    β€’ Ali Sinan’s iPhone (mobile) β€’ 00008030-000E0C4A3E91802E            β€’ ios            β€’ iOS 17.0.1 21A340
    β€’ iPhone 15 Pro Max (mobile)  β€’ EFA350D8-D6B5-4AE0-8611-B54055363A36 β€’ ios            β€’ com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    β€’ macOS (desktop)             β€’ macos                                β€’ darwin-arm64   β€’ macOS 13.5.2 22G91 darwin-arm64
    β€’ Chrome (web)                β€’ chrome                               β€’ web-javascript β€’ Google Chrome 117.0.5938.92

Solution

  • Just have to use the NativeAdapter(); for dio