title: Flutter occurs 'Error connecting to the service protocol: HttpException...' error on iOS device
body: <p>For network connection I use <code>dio</code> and for checking connection state from <code>Connectivity</code>.</p>
  
  <p>And in here I check network state:</p>
  
  <pre><code>@override
   Widget build(BuildContext context) {
  
   bloc.checkConnectivity(Connectivity());
  
   return StreamBuilder(
      stream: bloc.getInitApp,
      builder: (context, AsyncSnapshot&lt;InitApp&gt; initApp) {
        if (initApp.hasData) {
          return prepareMain(initApp.data);
        } else {
          return Center(
            child: CircularProgressIndicator(),
          );
        }
      });
  }
  </code></pre>
  
  <p><code>checkConnectivity</code> method:</p>
  
  <pre><code>checkConnectivity(Connectivity _connectivity) {
   _connectivity.onConnectivityChanged.listen((ConnectivityResult result){
     if (result == ConnectivityResult.mobile ||
         result == ConnectivityResult.wifi) {
         fetchInitApp();
      }
     });
   }
  </code></pre>
  
  <p>But eventually, App runs just on Android device but on iOS(Device/Simulator) occurs this error :</p>
  
  <pre><code>Error connecting to the service protocol: HttpException: , uri = http://127.0.0.1:1024/ws
  </code></pre>
  
  <p>I tried to call <code>Api</code> without <code>Connectivity</code> and the app work as good but with it gets data just in Android and for iOS still there is problem . </p>
  
  <p>Too, it happens with <code>Dart http</code> package . </p>
  
  <hr>
  
  <p><strong>Edit 1: 25 Sep 2019</strong></p>
  
  <p><code>This has nothing to do with codes!</code></p>
  
  <p><code>The problem is the system WiFi connection.</code></p>
  
  <p>When you faced with this problem use this temporary solution until a complete solution is provided:</p>
  
  <ol>
  <li>Disconnect system WiFi</li>
  <li>Unplug your phone</li>
  <li>Reconnect your system to WiFi</li>
  <li>Plug your phone</li>
  <li>Run the application</li>
  </ol>