'Ionic 5 Android signed image not showing
The signed version of android does not display images. The application is in Ionic 5 and has this problem only in the android version while in iOS it works.
UPDATE
This is how I set the image tag:
<img class="featured-book-cover" [src]="book.url">
UPDATE
I tried to set src attribute with fix url
This not work:
<img class="featured-book-cover" src="https://copertine.hoepli.it/archivio/978/8836/9788836009138.jpg"/>
This work:
<img class="featured-book-cover" src="https://apps.edigeo.it/copertine/9788836009138.jpeg" />
Solution 1:[1]
Considering that you are sure that the book object exists at the time the App shows the page for the users and the url is under SSL certificate (https). Looking at your img tag
it seems me you didn't close the tag. Please, try to do like this:
<img class="featured-book-cover" [src]="book.url" />
UPDATES
In my testes, both of your images works good. So please, could you see and share your meta tag <meta http-equiv="Content-Security-Policy" content="default-src *; media-src *; connect-src *;">
declared in the index.html
file, just to be sure there are no blocking images.
Are you using Cordova or Capacitor in your Ionic? In case of Cordova please, can you take a look into the config.xml
file to see if the Cordova allow list is able to many domains:
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
In case you are using Capacitor, please take a look into the capacitor.config.ts
file and check if there are some proxy and do the set up as you need or just clean up it if necessary.
server: {
url: 'https://your-domain.com',
allowNavigation:[
'your-domain.com',
'*.your-domain.com/*',
'localhost:8100/*'
]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |