FFImageLoading:Error: 7,80 Image loading failed: image.svg;(size=0x200,dip=True)
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
I get this error with most of svg.
You can try with this one for example: https://github.com/paulpatarinski/Xamarin.Forms.Plugins/blob/master/SVG/SampleApp/SampleApp/Images/Elvis.svg
I've just used our SVG sample with the file you provided (just set your url as a source( and it works just fine. Please add some more info, so I could reopen this.
Here's our sample code:

I ran into this issue thinking I could put the SVG in my Xamarin.Forms PCL project, however, that gave the above error. I then copied the svg to the Resources folder in my iOS project and then the drawable folder in my Android app and that worked.
Is there anyway to put it in the PCL and have it grab it that way?
I am experiencing the same problem but on Android only.
Both UWP and IOS renders the SVG, but on Android i keep on getting the error
`07-19 11:40:33.800 I/mono-stdout( 581): Image loading failed: background.svg;(size=0x888,type=SvgDataResolver)Image loading failed: background.svg;(size=0x888,type=SvgDataResolver)
07-19 11:40:33.800 I/mono-stdout( 581): System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String arg) [0x00029] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res) [0x0000c] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery (System.Int32& bytesCount, System.Int32& charsCount) [0x00064] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.GetChars (System.Int32 maxCharsCount) [0x00066] in <63ea794ff6b9415981d462623acacfa1>:0 07-19 11:40:33.801 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.801 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String arg) [0x00029] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.801 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res) [0x0000c] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.802 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.InvalidCharRecovery (System.Int32& bytesCount, System.Int32& charsCount) [0x00064] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.ReadData () [0x003d5] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.SwitchEncoding (System.Text.Encoding newEncoding) [0x00050] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.SwitchEncodingToUTF8 () [0x00008] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration (System.Boolean isTextDecl) [0x00886] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.802 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.GetChars (System.Int32 maxCharsCount) [0x00066] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.803 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.ReadData () [0x003d5] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.XmlTextReaderImpl.Read () [0x000c6] in <63ea794ff6b9415981d462623acacfa1>:0
at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00016] in <8601f5bfa75a4ac3aae791da2bc0c6e4>:0
at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader) [0x00000] in <8601f5bfa75a4ac3aae791da2bc0c6e4>:0 07-19 11:40:33.803 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.SwitchEncoding (System.Text.Encoding newEncoding) [0x00050] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.803 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.SwitchEncodingToUTF8 () [0x00008] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.804 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration (System.Boolean isTextDecl) [0x00886] in <63ea794ff6b9415981d462623acacfa1>:0
at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.XmlReader reader, System.Threading.CancellationToken token) [0x00000] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSkSvg.cs:100
at FFImageLoading.Svg.Platform.SKSvg.Load (System.IO.Stream stream, System.Threading.CancellationToken token) [0x00012] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSkSvg.cs:94
at FFImageLoading.Svg.Platform.SvgDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0019d] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSvgDataResolver.cs:232
at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:projectsffimageloadingsourceFFImageLoading.CommonDataResolversWrappedDataResolver.cs:21
at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImage07-19 11:40:33.804 I/mono-stdout( 581): at System.Xml.XmlTextReaderImpl.Read () [0x000c6] in <63ea794ff6b9415981d462623acacfa1>:0
07-19 11:40:33.805 I/mono-stdout( 581): at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00016] in <8601f5bfa75a4ac3aae791da2bc0c6e4>:0
Container,TImageView].RunAsync () [0x00300] in C:projectsffimageloadingsourceFFImageLoading.CommonWorkImageLoaderTask.cs:618 07-19 11:40:33.805 I/mono-stdout( 581): at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader) [0x00000] in <8601f5bfa75a4ac3aae791da2bc0c6e4>:0
07-19 11:40:33.805 I/mono-stdout( 581): at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.XmlReader reader, System.Threading.CancellationToken token) [0x00000] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSkSvg.cs:100
07-19 11:40:33.806 I/mono-stdout( 581): at FFImageLoading.Svg.Platform.SKSvg.Load (System.IO.Stream stream, System.Threading.CancellationToken token) [0x00012] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSkSvg.cs:94
07-19 11:40:33.806 I/mono-stdout( 581): at FFImageLoading.Svg.Platform.SvgDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0019d] in C:projectsffimageloadingsourceFFImageLoading.Svg.SharedSvgDataResolver.cs:232
07-19 11:40:33.807 I/mono-stdout( 581): at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:projectsffimageloadingsourceFFImageLoading.CommonDataResolversWrappedDataResolver.cs:21
07-19 11:40:33.807 I/mono-stdout( 581): at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618
Other svg's seems to be rendered just fine, but this one in a control template seems to give a problem.
<ControlTemplate x:Key="MainPage">
<AbsoluteLayout Padding="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<ffs:SvgCachedImage Source="background.svg" Aspect="AspectFill" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" />
=======Other stuff =======
Ok I found the issue.
In this case I had a resource called background.svg as well as a resource called background.png. It seems that android's resource generator does not differentiate well between them, forcing the imageloader to read the wrong item.
changing the name of the background.svg to something else fixed the problem.
@Spookenator you literally saved my life, thank you, sir!
Most helpful comment
Ok I found the issue.
In this case I had a resource called background.svg as well as a resource called background.png. It seems that android's resource generator does not differentiate well between them, forcing the imageloader to read the wrong item.
changing the name of the background.svg to something else fixed the problem.