question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVGImage not compatible work with Shared Projects

See original GitHub issue

In fact, Build Action is Embedded Resource is defined 😃

System.Exception: Error retrieving ic_call_black_24px.svg make sure Build Action is Embedded Resource at SVG.Forms.Plugin.iOS.SvgImageRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1 e) [0x00046] in <filename unknown>:0 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (Xamarin.Forms.Platform.iOS.TElement element) [0x00118] in <filename unknown>:0 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <filename unknown>:0 at Xamarin.Forms.Platform.iOS.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x0001b] in <filename unknown>:0 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x00006] in <filename unknown>:0 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001f] in <filename unknown>:0

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
xjrcodecommented, Jun 6, 2016

Even setting build action to embedded resource you have to write the resource ID “SvgTest.Images.github10.svg” in the properties pad as specified here

Now I’m getting the error “Invalid parameters to context creation” in iOS and “width and height must be > 0” in android.

0reactions
CNIAngelcommented, Jun 18, 2016

Ok I’ve been having a go at this for a few days now and I have no clue why I can’t get this to work. I made a completely new Shared project, installed the NuGet package, and just added a SvgImage to the generated main content page and my app is crashing after launch.

I thought it might have been the svg files I made so I grabbed the ones from the SampleApp and it’s still breaking.

I’ve tried putting the .svg inside the Resources/Drawable and making a folder in the main project. I set the .svg to EmbeddedResource. The IDs referring to them is correct.

Has anyone successfully gotten this package to work with Shared Project and would be willing to tell me what I’m doing wrong here?

  • EDIT - After banging my head on a wall all night I’ve got the SvgTest application to load a .svg file, the tiger one. Now I have to re-format the .svg files I made in InkScape so that they work as well. I only tested it in C# code and not in XAML tho so I don’t know if it works there.
Read more comments on GitHub >

github_iconTop Results From Across the Web

When i use .svg file "ERROR @<image> is not supported" ...
If your SVG only contains PNG images, then there is no point in using an SVG anyway. Just import your PNGs to your...
Read more >
Why doesn't my SVG work? - Scan N Cut
Why doesn't my SVG work? This is the question I often get asked and the answer is simple. Not all SVG files are...
Read more >
Troubleshooting SVG image errors in Mapbox Studio | Help
Custom images imported with Mapbox Studio can appear blank if the original SVG files contain no vector content, or no content in supported...
Read more >
How to use SVGs in React
Learn how to use or render an SVG image on a React webpage, the pros and cons, and using components like and ....
Read more >
Cricut Design Space Unsupported File Type Error ... - YouTube
This video shows the most common reasons for SVG upload errors in Cricut Design ... Text Elements Not Supported error in Cricut Design...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found