-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingplatform/androids/triagedIssue has been reviewedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versionPlease try to reproduce the potential issue on the latest public versiont/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
When running a MAUI project on Android using RichTextKit to render text on a SkiaSharp SKCanvasView control the following exception is thrown:
System.TypeLoadException
Message=Could not resolve type with token 0100000b from typeref (expected class 'System.ReadOnlySpan`1' in assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e')
I'm guessing that code is being trimmed that's needed?
Steps to Reproduce
- Create a new MAUI project
- Add a package reference to
SkiaSharp.Views.Maui.Controls - Add
.UseSkiaSharp()toMauiProgram - Change
MainPage.xamlto have this as content:
<Grid>
<sk:SKCanvasView PaintSurface="SKCanvasView_PaintSurface"/>
</Grid>- Add this to
MainPage.xaml.cs:
private void SKCanvasView_PaintSurface(object sender, SkiaSharp.Views.Maui.SKPaintSurfaceEventArgs e)
{
var text = new TextBlock();
var styleManager = StyleManager.Default.Value;
styleManager.FontSize(40);
styleManager.HaloColor(SKColors.Red);
styleManager.HaloWidth(4);
styleManager.HaloBlur(2);
text.AddText("Hello MAUI!", styleManager.CurrentStyle);
text.Paint(e.Surface.Canvas, new SKPoint(100, 200));
}Debug the app on Android (I'm using Pixel 5 - API 30 (Android 11.0 - API 30)) and get the error. Note that the app works fine when running as a Windows app.
Version with bug
Preview 13 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11 and up
Did you find any workaround?
No response
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingplatform/androids/triagedIssue has been reviewedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versionPlease try to reproduce the potential issue on the latest public versiont/bugSomething isn't workingSomething isn't working