androidimagehttpsandroid-9.0-piefresco

Fresco fails to load images in Android 9(Pie) unless the image URL is HTTPS


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?


Solution

  • Add this to AndroidManifest.xml file

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

    for more information refer this