Image not loading over http

Hi all!

I’m having a problem that is driving me crazy. I’m trying to show an image that is on a http URL but it only appears in the browser (ionic serve) but no in emulator or real device. The image with https URL works fine.

My HTML is:

<ion-header [translucent]="true">
    <ion-toolbar color="primary">
          <div style="float:left;padding-top: 5px;">
<ion-content class="fondo">
    <div style="width:100%;height:100%">            

        <ion-img src=""></ion-img>
        <ion-img src=""></ion-img>
        <img class="object-img" [src]="getImgContent()">

The first and the third images are not appearing but the second one is fine.
The third image is the same that the first one but with the url sanitized by:

import { Component } from '@angular/core';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { NavController } from '@ionic/angular';

  selector: 'app-radar',
  templateUrl: './',
  styleUrls: ['./'],

export class RadarPage {

    url: string;

  constructor(private navCtrl: NavController, public sanitizer:DomSanitizer, private route: ActivatedRoute) {

       this.url = "";

   getImgContent() {

        return this.sanitizer.bypassSecurityTrustUrl(this.url);

I have the whitelist plugin installed and in the config.xml:

<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="*" />
<allow-navigation href="*" />

And change the meta in the index.html:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * filesystem: data:">

I don’t know what else I could try!! Any ideas?

Thanks in advance


Finally I got the solution. Just put:


In my AndroidManifest.xml and edit/create the file network_security_config.xml:

<?xml version="1.0" encoding="utf-8"?>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true"></domain>