Recently updated from X-code 9.2 to 9.4 and Visual Studio / Mac up to 7.5.2 from not sure what, maybe 6 months since last update and now get a curious crash on release builds deployed to devices:
`04/06/2018 16:08:43 Error Application.Main(): Attempting to JIT compile method '(wrapper managed-to-native) CoreGraphics.ReleaseInfoCallback:wrapper_aot_native (object,intptr)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.
04/06/2018 16:08:43 Attempting to JIT compile method '(wrapper managed-to-native) CoreGraphics.ReleaseInfoCallback:wrapper_aot_native (object,intptr)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_ftnptr_to_delegate(intptr,intptr)
at (wrapper managed-to-native) CoreGraphics.CGPattern.CGPatternCreate(intptr,CoreGraphics.CGRect,CoreGraphics.CGAffineTransform,System.nfloat,System.nfloat,CoreGraphics.CGPatternTiling,bool,CoreGraphics.CGPatternCallbacks&)
at CoreGraphics.CGPattern..ctor (CoreGraphics.CGRect bounds, CoreGraphics.CGAffineTransform matrix, System.nfloat xStep, System.nfloat yStep, CoreGraphics.CGPatternTiling tiling, System.Boolean isColored, CoreGraphics.CGPattern+DrawPattern drawPattern) <0x100df2e78 + 0x0011f> in <0b60c1467e7449608ac42f9c7bbfdd05#c6f713f1d90acf3d6d155f26a69073db>:0
at XXX.iOS.MapEngine.GeofencePainter.SetGeoFenceHatching (CoreGraphics.CGContext context, UIKit.UIColor color, CoreGraphics.CGRect phase) <0x1014092d0 + 0x0026b> in <0e44a45acb814c7ea98ae3ea623cac96#c6f713f1d90acf3d6d155f26a69073db>:0
The crash happens within a minute or so of starting the app, but the pattern code is getting executed and the pattern fill appears on screen. The hatching function is as follows
private void SetGeoFenceHatching(CGContext context, UIColor color, CGRect phase)
{
RectangleF rect = new RectangleF(0, 0, 12, 12);
using (CGColorSpace patternColorSpace = CGColorSpace.CreatePattern(null))
{
context.SetFillColorSpace(patternColorSpace);
using (CGPattern pattern = new CGPattern(rect, CGAffineTransform.MakeIdentity(), rect.Width, rect.Height, CGPatternTiling.NoDistortion, true, ctx => {
ctx.SetStrokeColor(color.CGColor);
ctx.SetLineWidth(2f);
ctx.MoveTo(0f, 0f);
ctx.AddLineToPoint(12f, 12f);
ctx.StrokePath();
}))
{
context.SetFillPattern(pattern, new nfloat[] { 0.8f });
context.SetPatternPhase(new CGSize(phase.X, phase.Y));
}
}
}
Any suggestions as to why this is now blowing up?