title: Ionic 4 Http failure response for (unknown url): 0 Unknown Error. when calling api on real device
body: <p>I have an ionic 4 application which calls a .NET Core backend api.
  It works correctly on chrome browser, but when I run apk on android device, the response is:</p>
  
  <pre><code>{"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":null,"ok":false,"name":"HttpErrorResponse","message":"Http failure response for (unknown url): 0 Unknown Error","error":{"isTrusted":true}}
  </code></pre>
  
  <p>regarding to header I appended these options:</p>
  
  <pre><code>const httpOptions = {
      headers: new HttpHeaders({
          "Content-Type": "application/x-www-form-urlencoded; charset=utf-8" , 
          "Access-Control-Allow-Origin": "*", 
          "Access-Control-Allow-Headers": "Origin, Content-Type, X-Auth-Token, Accept, Authorization, X-Request-With",
          "Access-Control-Allow-Credentials" : "true",
          "Access-Control-Allow-Methods" : "GET, POST, DELETE, PUT, OPTIONS, TRACE, PATCH, CONNECT"  
         }) 
  };  
  </code></pre>
  
  <p>I have already installed plugin:
  cordova-plugin-ionic-webview</p>
  
  <p>and using HttpClient from "@angular/common/http"</p>
  
  <p><strong><em>My API hosted remotely, no ssl certificate used !</em></strong></p>
  
  <p>I googled all solutions, but none of them solve my problem</p>