1

I was using Fresco Image library to load images from the web in my Android app. It was working fine with most devices I had tested on (below Android 9). I recently got complaints that images weren't loading on Android 9(Pie) running devices. Since I didn't possess an android 9 device for testing, I was running it on the emulator. The issue had me completely bewildered because there were certain images loading fine whereas the others didn't. Lost a quite amount of time since the logs didn't make it obvious. The images that were being loaded were HTTPS based imageURLs and the HTTP ones didn't load.

Is this common with other image loading libraries like Glide and Picasso? Does this happen only in Android 9?

  • Did you try copying the problematic image URLs and loading it via browser? Just for debugging purpose. – Azhar92 Jul 05 '19 at 06:40
  • @Azhar92 yes it works fine in browsers and devices below Android 9. I have narrowed it down to the difference only being HTTPS (working) and HTTP (not being loaded) – Shyamnath Mallinathan Jul 05 '19 at 06:42
  • https://stackoverflow.com/a/56070618/4649110 – Basi Jul 05 '19 at 06:45
  • I think you may need to change library for loading images the popular and best images loader library in glide and picasso you should try. – Anas Mehar Jul 05 '19 at 06:49

1 Answers1

2

Add this to AndroidManifest.xml file

<application
    android:usesCleartextTraffic="true">
            ...
</application>

for more information refer this

Basi
  • 3,009
  • 23
  • 28