This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
This repository was archived by the owner on May 1, 2024. It is now read-only.
[Bug] [iOS] SkiaSharp Throws NullReferenceException by Using DrawTextOnPath #11479
Copy link
Copy link
Closed
Labels
4.6.0regression on 4.6.0regression on 4.6.0a/shapesexternal-skiai/highCompletely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less oftenCompletely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less ofteni/regressionin-progressThis issue has an associated pull request that may resolve it!This issue has an associated pull request that may resolve it!p/iOS 🍎s/needs-info ❓A question has been asked that requires an answer before work can continue on this issue.A question has been asked that requires an answer before work can continue on this issue.t/bug 🐛
Description
Description
@samhouts , created a new issue. I have a custom skiasharp view control that is rendering a text via a given path.
canvas.DrawTextOnPath("My Text", myPath, 0, 0, myPaint);
it throws the following error , it only affects the iOS not android. this maybe related to #11132 , and was working on XF 4.6
2020-07-17 23:10:32.706 {}.iOS[1606:1105574] System.NullReferenceException: Object reference not set to an instance of an object
at SkiaSharp.SKFont+GlyphPathCache.Dispose () [0x00016] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] glyphs, System.ReadOnlySpan`1[T] glyphWidths, System.ReadOnlySpan`1[T] glyphPositions, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign) [0x00158] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] glyphs, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00067] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.Void* text, System.Int32 length, SkiaSharp.SKTextEncoding encoding, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00042] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] text, SkiThe app has been terminated.
aSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00014] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00007] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKPoint offset, System.Boolean warpGlyphs, SkiaSharp.SKFont font, SkiaSharp.SKPaint paint) [0x00049] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKPoint offset, System.Boolean warpGlyphs, SkiaSharp.SKPaint paint) [0x0001c] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, System.Single hOffset, System.Single vOffset, SkiaSharp.SKPaint paint) [0x0000b] in <94e661f937c8433bbde4a540f6b2d091>:0
at {}.
OnPaintSurface (SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs args) [0x005fa] in C:\Dev\Repos\SensoDrive.Mobile\Infrastructure\Controls\ParkadeViewControl.cs:168
at SkiaSharp.Views.Forms.SKCanvasView.SkiaSharp.Views.Forms.ISKCanvasViewController.OnPaintSurface (SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs e) [0x00000] in <2ffb8e9bd89b4976990ab464a4bbda58>:0
at SkiaSharp.Views.Forms.SKCanvasViewRendererBase`2[TFormsView,TNativeView].OnPaintSurface (System.Object sender, SkiaSharp.Views.iOS.SKPaintSurfaceEventArgs e) [0x00021] in <2ffb8e9bd89b4976990ab464a4bbda58>:0
at SkiaSharp.Views.iOS.SKCanvasView.OnPaintSurface (SkiaSharp.Views.iOS.SKPaintSurfaceEventArgs e) [0x0000a] in <2fda334037b543eabdad1306dbaab73a>:0
at SkiaSharp.Views.iOS.SKCanvasView.Draw (CoreGraphics.CGRect rect) [0x00064] in <2fda334037b543eabdad1306dbaab73a>:0
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr princi
The app has been terminated.
pal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at SpotLee.iOS.Application.Main (System.String[] args) [0x00002] in {}\Main.cs:20
2020-07-17 23:10:32.706 {}[1606:1105574] Object reference not set to an instance of an object
2020-07-17 23:10:32.711 {}[1606:1105574] at SkiaSharp.SKFont+GlyphPathCache.Dispose () [0x00016] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] glyphs, System.ReadOnlySpan`1[T] glyphWidths, System.ReadOnlySpan`1[T] glyphPositions, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign) [0x00158] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] glyphs, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00067] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.Void* text, System.Int32 length, SkiaSharp.SKTextEncoding encoding, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00042] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.ReadOnlySpan`1[T] text, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00
014] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKFont.GetTextPathOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKTextAlign textAlign, SkiaSharp.SKPoint origin) [0x00007] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKPoint offset, System.Boolean warpGlyphs, SkiaSharp.SKFont font, SkiaSharp.SKPaint paint) [0x00049] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, SkiaSharp.SKPoint offset, System.Boolean warpGlyphs, SkiaSharp.SKPaint paint) [0x0001c] in <94e661f937c8433bbde4a540f6b2d091>:0
at SkiaSharp.SKCanvas.DrawTextOnPath (System.String text, SkiaSharp.SKPath path, System.Single hOffset, System.Single vOffset, SkiaSharp.SKPaint paint) [0x0000b] in <94e661f937c8433bbde4a540f6b2d091>:0
at Infrastructure.Controls.ParkadeViewControl.OnPaintSurface (SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs args) [0x005fa] in {}:168
at SkiaSharp.Views.Forms.SKCanvasView.SkiaSharp.Views.Forms.ISKCanvasViewController.OnPaintSurface (SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs e) [0x00000] in <2ffb8e9bd89b4976990ab464a4bbda58>:0
at SkiaSharp.Views.Forms.SKCanvasViewRendererBase`2[TFormsView,TNativeView].OnPaintSurface (System.Object sender, SkiaSharp.Views.iOS.SKPaintSurfaceEventArgs e) [0x00021] in <2ffb8e9bd89b4976990ab464a4bbda58>:0
at SkiaSharp.Views.iOS.SKCanvasView.OnPaintSurface (SkiaSharp.Views.iOS.SKPaintSurfaceEventArgs e) [0x0000a] in <2fda334037b543eabdad1306dbaab73a>:0
at SkiaSharp.Views.iOS.SKCanvasView.Draw (CoreGraphics.CGRect rect) [0x00064] in <2fda334037b543eabdad1306dbaab73a>:0
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/
Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at {}.iOS.Application.Main (System.String[] args) [0x00002] in {}\Main.cs:20
Basic Information
- Version with issue: Xform latest stable version 4.7.0.1142 ,Latest VS 2019, 16.6.4, Xamarin.iOS and Xamarin.Mac SDK 13.18.2.1
- Last known good version: 4.6
Workaround
i don't have a workaround - if I downgrade to 4.6 it works.
Metadata
Metadata
Assignees
Labels
4.6.0regression on 4.6.0regression on 4.6.0a/shapesexternal-skiai/highCompletely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less oftenCompletely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less ofteni/regressionin-progressThis issue has an associated pull request that may resolve it!This issue has an associated pull request that may resolve it!p/iOS 🍎s/needs-info ❓A question has been asked that requires an answer before work can continue on this issue.A question has been asked that requires an answer before work can continue on this issue.t/bug 🐛