Glide not showing SVG image

45 views Asked by At

I'm using Glide to show SVG flag inside an ImageView. When i use PNG url it works perfectly, instead when i use SVG url it doesn't work.

private void loadImage(String country, ImageView flag) {
     String pUrl = "https://hatscripts.github.io/circle-flags/flags/" + country.toLowerCase() + ".svg";
     Thread imageDataThread = new Thread(() -> {
        runOnUiThread(() -> GlideApp.with(flag.getContext()).load(pUrl).override(120,120).into(flag));
     });
     imageDataThread.start();
}

This is the error it displays:

Load failed for [https://hatscripts.github.io/circle-flags/flags/ae.svg] with dimensions [120x120]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource

There were 10 root causes:
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
call GlideException#logRootCauses(String) for more detail
                                                                                                  

I tried various things to fix but i didn't found the right way. Can you help me to solve this?

0

There are 0 answers