Closed fullStackOasis closed 2 years ago
The SVG sample is meant to show you how to integrate a third party library, it's not an official integration library in its own right (those are under integration/).
I'm not entirely sure, but it looks like the SVG library the sample is using can't handle these files. Have you tried updating it to a newer version? Assuming it's still being maintained it should just be incrementing the version number here: https://github.com/bumptech/glide/blob/6ba4b548cae12f3aa53634a59025069834c0ea14/samples/svg/build.gradle#L6
@sjudd Thank you! I switched the line from
implementation 'com.caverock:androidsvg:1.2.1'
to
implementation 'com.caverock:androidsvg-aar:1.4'
and ran ./gradlew :samples:svg:run
and now the demo works.
Glide Version: 4.13.0
Integration libraries: None. I am using your own example, the SVG sample code, so I'm just running
./gradlew :samples:svg:run
Device/Android Version: Galaxy A71 5G
Issue details / Repro steps / Use case background: In your SVG sample, you load an embedded SVG on the left side of the layout, and pull an SVG image from the internet on the right side of the layout.
Well, since the SVG image on the net is at an http (not https) location, it does not load. No surprise! It's a bad example, and that should be fixed... However, I replaced that image with a image from an https resource - https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/check.svg - in fact, I tried multiple SVG images from the w3.org site. And none of them would load. I'd always see the red x that indicates failure, or else I'd see the 3 dots indicating loading, but the remote svg would never load. I saw different exceptions in the logs.
Glide load line /
GlideModule
(if any) / list Adapter code (if any):Again - this is just your own sample code where I see the failure. I have a need for a library that will load an svg file from the internet and display it (in a RecyclerView). And I've been using Glide with great success up until now, when I needed it to load multiple svgs from the net.
Layout XML: Please see your own svg sample
Stack trace / LogCat:
This is the error when using an http resource:
Well, yeah, again, no surprise that the sample's http url does not load.
But, here is an example when trying this url: https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/basura.svg
When I tried this less complex svg, I just saw the 3 dots loading indicator in the sample app, and no exception in logcat: https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/cc.svg
I appreciate your work, and any help you can offer to fix this problem. Thanks!