title: ionic3 Http failure response for (unknown url): 0 Unknown Error for android and ios build , this works fine with "ionic serve"
body: <p>how to fixed the issue of cross origin request requested from android and ios builds if ionic3. I am able to access  the same en points using ionic serve from the browser, but as i try to take the production build and access the endpoints i am getting the above error.</p>
  
  <p>Also i even tried the ssl server test check where i am getting this "Assessment failed: No secure protocols supported". I am not getting how to fix this. Does any one face the same issue ? or knows how to tackle this .....</p>
  
  <p>i have imported </p>
  
  <pre><code>import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
  </code></pre>
  
  <p>and set the headers with</p>
  
  <pre><code>   headers = new HttpHeaders().set('Content-Type', "application/json");
  
  
   return new Promise((resolve, reject) =&gt; {
                  this.http.post(TASK.BASEURL + task, requestData, { headers: headers, params: extraParams })
                    .map(res =&gt; res)
                    .subscribe(response =&gt; {
                      resolve(response);
                    }, error =&gt; {
                      reject(error)
                    });
                });
  </code></pre>
  
  <p>-----------------------------------Error Log ---------------------------------</p>
  
  <p>11-27 18:09:55.919 5813-10986/? D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
  11-27 18:09:55.985 10808-10808/io.ionic.starter D/SystemWebChromeClient: <a href="http://localhost:8080/#/login" rel="nofollow noreferrer">http://localhost:8080/#/login</a>: Line 0 : Access to XMLHttpRequest at '<a href="http://www.xxxxxxxxxxxxx.com/api/login" rel="nofollow noreferrer">http://www.xxxxxxxxxxxxx.com/api/login</a>' from origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
  11-27 18:09:55.985 10808-10808/io.ionic.starter I/chromium: [INFO:CONSOLE(0)] "Access to XMLHttpRequest at '<a href="http://www.xxxxxxxxxxxxx.com/api/login" rel="nofollow noreferrer">http://www.xxxxxxxxxxxxx.com/api/login</a>' from origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.", source: <a href="http://localhost:8080/#/login" rel="nofollow noreferrer">http://localhost:8080/#/login</a> (0)
  11-27 18:09:56.454 7163-7182/? I/Finsky: [1422] com.google.android.finsky.bp.an.run(6): Stats for Executor: BlockingExecutor com.google.android.finsky.bp.ao@afe5f2f[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 7]
      [1422] com.google.android.finsky.bp.an.run(6): Stats for Executor: LightweightExecutor com.google.android.finsky.bp.ao@ca9093c[Running, pool size = 4, active threads = 0, queued tasks = 0, completed tasks = 55]
  11-27 18:09:56.500 7163-7182/? I/Finsky: [1422] com.google.android.finsky.bp.an.run(6): Stats for Executor: bgExecutor com.google.android.finsky.bp.ao@53166c5[Running, pool size = 4, active threads = 0, queued tasks = 0, completed tasks = 9]</p>