Repository navigation
Closed
Copy link
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.triage/untriagedIndicates an issue requires triaging or verification
Description
Current behavior 🐛
After updating to Uno.Sdk 6.2.29 (or latest 6.3.0-dev vesions), SVG images no longer display, and the app logs a TypeLoadException from Uno.UI.Svg. The same sample project provided as an example works properly with Uno.Sdk 6.1.23.
fail: Uno.UI.Svg.SvgProvider[0]
Failed to load SVG image.
System.TypeLoadException: Method 'GetFontMetrics' in type 'Uno.Svg.Skia.SkiaAssetLoader' from assembly 'Uno.UI.Svg, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at Uno.Svg.Skia.SKSvg..ctor()
at Uno.UI.Svg.SvgProvider.<>c__DisplayClass23_0.<LoadSvgAsync>b__0() in C:\a\1\s\src\AddIns\Uno.UI.Svg\SvgProvider.cs:line 165
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Uno.UI.Svg.SvgProvider.TryLoadSvgDataAsync(Byte[] svgBytes) in C:\a\1\s\src\AddIns\Uno.UI.Svg\SvgProvider.cs:line 119
Expected behavior 🎯
SVG renders properly even after 6.2.x or above version update.
How to reproduce it (as minimally and precisely as possible) 🔬
- Create a new Uno Blank app, for example, with Uno.Sdk 6.2.29 (or latest 6.3.0-dev vesions)
- Enable the
Svg;UnoFeature in the ProjectName.csproj (following the SVG documentation) - Add an SVG file under
Assets/Svg/(e.g.,Assets/Svg/logo.svg). - Add
<Image Source="ms-appx:///Assets/Svg/logo.svg" />in theStackPanelinMainPage.xaml
OR
- Use the sample repro app: UnoSvgIssueRepro.zip
Then:
- Launch the app for any platform (e.g., Desktop)
- Notice the System.TypeLoadException, and the SVG is not displayed using Uno.Sdk 6.2.29
(Compare using Uno.Sdk 6.1.23 and notice no exception, and the SVG logo is properly displayed.)
Workaround 🛠️
Override the Svg.Skia version to 3.0.3 by adding <SvgSkiaVersion>3.0.3</SvgSkiaVersion> to your ProjectName.csproj.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
All platforms 🌍
Uno.Sdk version (and other relevant versions) 📦
6.2.29, 6.3.0-dev latest versions
IDE version 🧑💻
VS 2022 - 17.14.13
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.triage/untriagedIndicates an issue requires triaging or verification
Activity
[-][SVG] TypeLoadException with Uno.Sdk 6.2.29: SkiaAssetLoader.GetFontMetrics missing implementation → SVGs don’t render[/-][+]SVG] TypeLoadException with Uno.Sdk 6.2.29: SVGs fail to render[/+][-]SVG] TypeLoadException with Uno.Sdk 6.2.29: SVGs fail to render[/-][+][SVG] TypeLoadException with Uno.Sdk 6.2.29: SVGs fail to render[/+]agneszitte commentedon Aug 28, 2025
This issue seems related to the Svg.Skia version used by the Templates/SDK.
When overriding the Svg.Skia version here are the results:
System.TypeLoadException(and even started with 3.0.4-beta.1)System.TypeLoadExceptionSystem.TypeLoadExceptionagneszitte commentedon Aug 28, 2025
Digging further, here is a summary of the details:
This issue started with Svg.Skia PR – "Use SKIA text metrics" : Use SKIA text metrics wieslawsoltes/Svg.Skia#318
Starting with Svg.Skia 3.0.4-beta.1, the
ISvgAssetLoaderinterface gained two new methods:GetFontMetrics(SKPaint paint)MeasureText(string? text, SKPaint paint, ref SKRect bounds)In Svg.Skia 3.0.4-beta.2, an additional method was introduced (Add text path conversion wieslawsoltes/Svg.Skia#326):
GetTextPath(string? text, SKPaint paint, float x, float y)Uno’s current
SkiaAssetLoaderonly implementsLoadImageandFindTypefaces.When running against Svg.Skia 3.0.4 or later, these new methods are missing, which leads to a
TypeLoadException.Impact
GetFontMetrics/MeasureText/GetTextPath)What this means for Uno
Override the
Svg.Skiaversion to 3.0.3 by adding<SvgSkiaVersion>3.0.3</SvgSkiaVersion>to yourProjectName.csproj.Templates/SDK should constrain to Svg.Skia 3.0.3 to avoid breaking new apps.
Update Uno’s
SkiaAssetLoaderto implement the new APIs (GetFontMetrics,MeasureText, andGetTextPath) so it works with Svg.Skia ≥ 3.0.4.agneszitte commentedon Aug 28, 2025
Final details and next steps ✅
PR to pin Svg.Skia to 3.0.3 in Templates/SDK for now, this will fix the current issue:
chore(Svg.Skia): Pin Svg.Skia to 3.0.3 in templates/sdk to avoid breaking changes introduced with version ≥ 3.0.4 uno.templates#1753
PR to exclude Svg.Skia from auto-updates in the updater tool (to prevent accidental upgrades past 3.0.3):
feat(Uno.Sdk.Updater): Add CLI exclude-file support and improve manifest merge logic uno.templates#1752
Separate issue opened to implement missing
ISvgAssetLoaderAPI support (GetFontMetrics,MeasureText,GetTextPath):[SVG] Implement missing ISvgAssetLoader APIs (GetFontMetrics, MeasureText, GetTextPath) for compatibility with Svg.Skia ≥ 3.0.4 #21378
MartinZikmund commentedon Sep 3, 2025
@agneszitte the update of Svg.Skia was merged in master
khaskoul commentedon Sep 8, 2025
Fixed with latest SDK version 6.2.36
Tested with:
Templates/SDK: 6.2.36
Platform(s): Desktop
IDE: Rider 2025.2, VS Code 1.102.3
OS: Linux
jhanvi03 commentedon Sep 8, 2025
Issue resolved in latest sdk/template 6.2.36 svg image is visible on all TFMs
tested with:
Sdk/Template: 6.2.36
OD: Mac, Windows
IDE: Rider, VS
TFMs: All
Snapshots
Desktop:

WebAssembly:
Android
iOS:
agneszitte commentedon Sep 8, 2025
Fix available with 6.2.36
github-actions commentedon May 1, 2026
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.