FFImageLoading
FFImageLoading copied to clipboard
SVG Image loading failed
🐛 Bug Report
Some SVG's are not rendered. A exception is thrown : Image loading failed.
Image loading failed: resource://App1.Resources.package.svg?assembly=App1,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=null;(size=0x48,type=SvgDataResolver)
System.NullReferenceException: Object reference not set to an instance of an object.
at FFImageLoading.Svg.Platform.SKSvg.ReadElement (System.Xml.Linq.XElement e, System.Collections.Generic.Dictionary`2[TKey,TValue] style) [0x0022e] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:558
at FFImageLoading.Svg.Platform.SKSvg.ReadElement (System.Xml.Linq.XElement e, SkiaSharp.SKCanvas canvas, SkiaSharp.SKPaint stroke, SkiaSharp.SKPaint fill, System.Boolean isMask, System.Threading.CancellationToken token) [0x006d7] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:343
at FFImageLoading.Svg.Platform.SKSvg.LoadElements (System.Collections.Generic.IEnumerable`1[T] elements, SkiaSharp.SKCanvas canvas, SkiaSharp.SKPaint stroke, SkiaSharp.SKPaint fill, System.Threading.CancellationToken token) [0x00010] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:221
at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.Linq.XDocument xdoc, System.Threading.CancellationToken token) [0x00417] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:209
at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.XmlReader reader, System.Threading.CancellationToken token) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:100
at FFImageLoading.Svg.Platform.SKSvg.Load (System.IO.Stream stream, System.Threading.CancellationToken token) [0x00012] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:94
at FFImageLoading.Svg.Platform.SvgDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0019d] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SvgDataResolver.cs:232
at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21
at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618
My other SVG's are correctly rendered. I use https://jakearchibald.github.io/svgomg/ to minimize SVG's.
Expected behavior
SVG should be rendered.
Reproduction steps
Place the SVG from zip in a folder Resources of the project package.zip XAML :
<ffimageloading:SvgCachedImage
Source="resource://App1.Resources.package.svg" />
Configuration
Version: 2.4.11.982
Platform:
- [x] :robot: Android
- [x] :monkey: Xamarin.Forms
Can someone help me about this ?
same issue here. @bnserig did you find any solution?
No. I didn't find anything.
PS : Is this repository still active ? Because there is no release since May 2019.
@bnserig not sure. but I found similar issue here and the solution provided there worked for me.
Well, this is not exactly the same error log. I tried to change my image package.svg to another name, but the result is the same.
I'm seeing the same issue with one of my svgs. Works fine for others. Tried minimising also.