Open ksoftllc opened 2 weeks ago
Also, this crash does not get reported by Sentry.io like other uncaught exceptions.
Does this replicate with something that isn't your application (Ex. a new Template app?) or does it only happen when run in your app?
I have not been able to create a simple app to reproduce the crash. But it happens 100% of the time on iPad.
I did add a catch in Program.cs
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
try
{
UIApplication.Main(args, null, typeof(AppDelegate));
}
catch (System.Exception ex)
{
var logger = MauiProgram.ServiceProvider.GetService<ILogger>();
logger.LogError(true, ex, $"Uncaught exception {ex.Message}");
}
}
}
Here is the logged exception:
Uncaught exception Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 810}, scale=2.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.
Native stack trace:
0 CoreFoundation 0x000000019ea4c7d8 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 534488
1 libobjc.A.dylib 0x000000019bd1f2e4 objc_exception_throw + 88
2 Foundation 0x000000019de1ca78 6D0212CC-3B9E-32C9-BE20-72989CE3ACB8 + 8452728
3 UIKitCore 0x00000001a125b55c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 701788
4 FleetHDMobile 0x0000000102c6195c FleetHDMobile + 9591132
5 FleetHDMobile 0x0000000102f62a30 AppleCryptoNative_X509ImportCertificate + 2881592
6 FleetHDMobile 0x0000000102f5718c AppleCryptoNative_X509ImportCertificate + 2834324
7 FleetHDMobile 0x0000000102f54c4c AppleCryptoNative_X509ImportCertificate + 2824788
8 FleetHDMobile 0x0000000102f238b4 AppleCryptoNative_X509ImportCertificate + 2623164
9 FleetHDMobile 0x0000000102ecbf08 AppleCryptoNative_X509ImportCertificate + 2264336
10 FleetHDMobile 0x0000000102eced40 AppleCryptoNative_X509ImportCertificate + 2276168
11 FleetHDMobile 0x0000000102f91d98 AppleCryptoNative_X509ImportCertificate + 3074976
12 FleetHDMobile 0x0000000102fc24b0 AppleCryptoNative_X509ImportCertificate + 3273400
13 UIKitCore 0x00000001a122044c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 459852
14 UIKitCore 0x00000001a1295da0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 941472
15 UIKitCore 0x00000001a12349f8 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543224
16 UIKitCore 0x00000001a1234afc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
17 UIKitCore 0x00000001a1234afc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
18 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
19 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
20 UIKitCore 0x00000001a1234afc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
21 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
22 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
23 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
24 UIKitCore 0x00000001a1234ba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
25 UIKitCore 0x00000001a1234afc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
26 UIKitCore 0x00000001a1234720 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 542496
27 UIKitCore 0x00000001a1234618 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 542232
28 UIKitCore 0x00000001a11bd0c0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 53440
29 QuartzCore 0x00000001a04f3c28 D8E8E86D-85AC-3C90-B2E1-940235ECAA18 + 494632
30 UIKitCore 0x00000001a1200138 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 327992
31 UIKitCore 0x00000001a1ccc3ac __UIVIEWCONTROLLERTRANSITIONCOORDINATOR_IS_EXECUTING_ALONGSIDE_ANIMATION_BLOCK__ + 36
32 UIKitCore 0x00000001a1493648 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3028552
33 UIKitCore 0x00000001a1493518 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3028248
34 UIKitCore 0x00000001a1ce1310 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 11735824
35 UIKitCore 0x00000001a16c9a50 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 5347920
36 UIKitCore 0x00000001a1326e40 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1535552
37 UIKitCore 0x00000001a1326308 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1532680
38 UIKitCore 0x00000001a1510cec 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3542252
39 UIKitCore 0x00000001a1510904 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3541252
40 UIKitCore 0x00000001a138734c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1930060
41 UIKitCore 0x00000001a15bc378 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4244344
42 UIKitCore 0x00000001a15bccd0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4246736
43 UIKitCore 0x00000001a19db1e0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8565216
44 UIKitCore 0x00000001a153c0ac 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3719340
45 UIKitCore 0x00000001a19db160 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8565088
46 UIKitCore 0x00000001a122ff30 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 524080
47 UIKitCore 0x00000001a19da20c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561164
48 UIKitCore 0x00000001a19da0fc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8560892
49 UIKitCore 0x00000001a19da340 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561472
50 UIKitCore 0x00000001a2503c64 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 20266084
51 UIKitCore 0x00000001a22f3414 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18101268
52 UIKitCore 0x00000001a22f4610 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105872
53 FrontBoardServices 0x00000001b8047088 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467080
54 FrontBoardServices 0x00000001b80470a4 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467108
55 FrontBoardServices 0x00000001b80470a4 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467108
56 FrontBoardServices 0x00000001b8046b1c D627737B-3C6C-3308-A90C-AD705542C2B3 + 465692
57 UIKitCore 0x00000001a22f4560 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105696
58 UIKitCore 0x00000001a22f3e00 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18103808
59 UIKitCore 0x00000001a22f4410 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105360
60 UIKitCore 0x00000001a19da278 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561272
61 UIKitCore 0x00000001a19da490 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561808
62 UIKitCore 0x00000001a22f428c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18104972
63 UIKitCore 0x00000001a27b7954 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 23099732
64 UIKitCore 0x00000001a27b77d0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 23099344
65 UIKitCore 0x00000001a13c6190 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2187664
66 UIKitCore 0x00000001a1485824 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2971684
67 UIKitCore 0x00000001a1485404 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2970628
68 FrontBoardServices 0x00000001b800c1bc D627737B-3C6C-3308-A90C-AD705542C2B3 + 225724
69 FrontBoardServices 0x00000001b800bd6c D627737B-3C6C-3308-A90C-AD705542C2B3 + 224620
70 FrontBoardServices 0x00000001b7fdb3c8 D627737B-3C6C-3308-A90C-AD705542C2B3 + 25544
71 FrontBoardServices 0x00000001b7fe9db8 D627737B-3C6C-3308-A90C-AD705542C2B3 + 85432
72 FrontBoardServices 0x00000001b7fe9c44 D627737B-3C6C-3308-A90C-AD705542C2B3 + 85060
73 FrontBoardServices 0x00000001b7fee114 D627737B-3C6C-3308-A90C-AD705542C2B3 + 102676
74 libdispatch.dylib 0x00000001a67220d0 7DE7EC03-CFB7-349D-9B9E-8782B38F231D + 16592
75 libdispatch.dylib 0x00000001a6725b14 7DE7EC03-CFB7-349D-9B9E-8782B38F231D + 31508
76 FrontBoardServices 0x00000001b7feb300 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90880
77 FrontBoardServices 0x00000001b7feb280 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90752
78 FrontBoardServices 0x00000001b7feb158 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90456
79 CoreFoundation 0x000000019ea20328 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 353064
80 CoreFoundation 0x000000019ea202bc 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 352956
81 CoreFoundation 0x000000019ea1ddc0 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 343488
82 CoreFoundation 0x000000019ea1cfbc 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 339900
83 CoreFoundation 0x000000019ea1c830 CFRunLoopRunSpecific + 588
84 GraphicsServices 0x00000001ea9fc1c4 GSEventRunModal + 164
85 UIKitCore 0x00000001a1582eb0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4009648
86 UIKitCore 0x00000001a16315b4 UIApplicationMain + 340
87 FleetHDMobile 0x0000000102c781f4 xamarin_UIApplicationMain + 60
88 FleetHDMobile 0x0000000102f63da4 AppleCryptoNative_X509ImportCertificate + 2886572
89 FleetHDMobile 0x0000000102f626a4 AppleCryptoNative_X509ImportCertificate + 2880684
90 FleetHDMobile 0x0000000102f570b4 AppleCryptoNative_X509ImportCertificate + 2834108
91 FleetHDMobile 0x0000000102f54c4c AppleCryptoNative_X509ImportCertificate + 2824788
92 FleetHDMobile 0x0000000102f238b4 AppleCryptoNative_X509ImportCertificate + 2623164
93 FleetHDMobile 0x0000000102ecaff4 AppleCryptoNative_X509ImportCertificate + 2260476
94 FleetHDMobile 0x0000000102ed12f0 AppleCryptoNative_X509ImportCertificate + 2285816
95 FleetHDMobile 0x0000000102f28ed0 AppleCryptoNative_X509ImportCertificate + 2645208
96 FleetHDMobile 0x0000000102c8f2f0 xamarin_log + 22332
97 FleetHDMobile 0x0000000102f9166c AppleCryptoNative_X509ImportCertificate + 3073140
98 dyld 0x00000001c440aec8 3060D36A-16CE-3C3A-9258-3881459F5714 + 212680
I cannot figure out what about going into the background would produce this crash.
Also, why does AppleCryptoNative_X509ImportCertificate appears so many times? And why would crypto be interspersed with UIKit calls? Is this happening due to snapshotting by iOS when the app goes to background?
Are you using background services? https://developer.apple.com/documentation/xcode/configuring-background-execution-modes
Like fetch or processing?
From the stack trace it's clear that iOS kills your app because it ran in the background for more than 10 seconds, which is not allowed.
@albyrock87 No, no background services.
using BackgroundTasks;
using CoreFoundation;
using FleetHDMobile.Platforms.iOS;
using FleetHDMobile.Services;
using Foundation;
using Microsoft.Extensions.Logging;
using UIKit;
namespace FleetHDMobile;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
public override void PerformActionForShortcutItem(UIApplication application, UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler)
=> Platform.PerformActionForShortcutItem(application, shortcutItem, completionHandler);
}
@ksoftllc well, that PerformActionForShortcutItem
is kind of a background service.
Are you invoking the completionHandler
within a few seconds?
I simplified the AppDelegate to just this, but it still crashes.
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
The stack trace shows AppleCryptoNative_X509ImportCertificate activity, which I really don't understand why. When the app is backgrounded or even foregrounded, there is nothing in the code that would explicitly invoke crypto.
Thanks for confirming. I guess that part might be related to the underlying implementation of the HttpClientMessageHandler. Besides that, I don't have anything to add here to further investigate the issue.
More info from additional logging. Here is a stack trace of the crash:
at ObjCRuntime.Runtime.ThrowNSException(IntPtr ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 564
at UIKit.UIGraphics.BeginImageContextWithOptions(CGSize , Boolean , NFloat ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGraphics.cs:line 92
at Microsoft.Maui.Controls.Platform.BrushExtensions.GetBackgroundImage(UIView control, Brush brush)
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.UpdateBackground()
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.HandleShellPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.Shell.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.AppThemeBinding.<>c__DisplayClass11_0.<ApplyCore>g__Set|0()
at Microsoft.Maui.Controls.AppThemeBinding.ApplyCore(Boolean dispatch)
at Microsoft.Maui.Controls.AppThemeBinding.Apply(Boolean fromTarget)
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.OnAppThemeChanged()
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.<>c.<.cctor>b__8_0(BindableObject bindable, Object oldValue, Object newValue)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.TriggerThemeChangedActual()
at Microsoft.Maui.Controls.Application.set_PlatformAppTheme(AppTheme value)
at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.ThemeChanged()
at Microsoft.Maui.Platform.PageViewController.TraitCollectionDidChange(UITraitCollection previousTraitCollection)
__- End of stack trace from previous location __-
http client called
[2024-11-12 11:39:29,373][ERR][FleetHdMobileApiClient.Setting.cs:37] Exception pulling Driver Agent Setting for tenant , uri: ///setting/dasetting
System.InvalidOperationException: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set.
at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage )
at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage )
at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage , HttpCompletionOption , CancellationToken )
at System.Net.Http.HttpClient.GetAsync(Uri , HttpCompletionOption , CancellationToken )
at System.Net.Http.HttpClient.GetAsync(Uri , HttpCompletionOption )
at System.Net.Http.HttpClient.GetAsync(Uri )
at System.Net.Http.HttpClient.GetAsync(String )
at FleetHDMobile.Services.FleetHdApi.HttpServiceBase.<GetHttpAsync>d__5`1[[FleetHd.Mobile.Contracts.Setting.DriverAgentSettingDto, FleetHd.Mobile.Contracts, Version=2.18.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/FleetHdApi/HttpServiceBase.cs:line 25
at FleetHDMobile.Services.FleetHdApi.FleetHdMobileApiClient.<GetDriverAgentSetting>b__25_0() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/FleetHdApi/FleetHdMobileApiClient.Setting.cs:line 33
[2024-11-12 11:39:29,574][ERR][DriverAgentSettingService.cs:132] using default setting from device because of this exception
System.InvalidOperationException: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set.
at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage )
at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage )
at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage , HttpCompletionOption , CancellationToken )
at System.Net.Http.HttpClient.GetAsync(Uri , HttpCompletionOption , CancellationToken )
at System.Net.Http.HttpClient.GetAsync(Uri , HttpCompletionOption )
at System.Net.Http.HttpClient.GetAsync(Uri )
at System.Net.Http.HttpClient.GetAsync(String )
at FleetHDMobile.Services.FleetHdApi.HttpServiceBase.<GetHttpAsync>d__5`1[[FleetHd.Mobile.Contracts.Setting.DriverAgentSettingDto, FleetHd.Mobile.Contracts, Version=2.18.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/FleetHdApi/HttpServiceBase.cs:line 25
at FleetHDMobile.Services.FleetHdApi.FleetHdMobileApiClient.<GetDriverAgentSetting>b__25_0() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/FleetHdApi/FleetHdMobileApiClient.Setting.cs:line 38
at FleetHDMobile.Services.FleetHdApi.FleetHdMobileApiClient.GetDriverAgentSetting() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/FleetHdApi/FleetHdMobileApiClient.Setting.cs:line 27
at FleetHDMobile.Services.DriverAgentSettingService.SaveDefaultSettingsAsync() in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Services/DriverAgentSettingService.cs:line 123
[2024-11-12 11:39:35,137][INF][:] enrolling
[2024-11-12 11:39:35,15][INF][:] decrytping
[2024-11-12 11:39:35,215][INF][:] decrypted
[2024-11-12 11:39:35,228][INF][:] Start processing HTTP request GET https://identity-test.fleethd.com/.well-known/openid-configuration
[2024-11-12 11:39:35,234][INF][:] Sending HTTP request GET https://identity-test.fleethd.com/.well-known/openid-configuration
[2024-11-12 11:39:35,718][INF][:] Received HTTP response headers after 479.8343ms - 200
[2024-11-12 11:39:35,724][INF][:] End processing HTTP request after 499.5539ms - 200
[2024-11-12 11:39:35,74][INF][:] Start processing HTTP request GET https://identity-test.fleethd.com/.well-known/openid-configuration/jwks
[2024-11-12 11:39:35,742][INF][:] Sending HTTP request GET https://identity-test.fleethd.com/.well-known/openid-configuration/jwks
[2024-11-12 11:39:35,891][INF][:] Received HTTP response headers after 145.4607ms - 200
[2024-11-12 11:39:35,897][INF][:] End processing HTTP request after 156.005ms - 200
[2024-11-12 11:39:35,937][INF][:] Start processing HTTP request POST https://identity-test.fleethd.com/connect/token
[2024-11-12 11:39:35,938][INF][:] Sending HTTP request POST https://identity-test.fleethd.com/connect/token
[2024-11-12 11:39:36,18][INF][:] Received HTTP response headers after 236.9353ms - 200
[2024-11-12 11:39:36,19][INF][:] End processing HTTP request after 251.5533ms - 200
[2024-11-12 11:39:36,228][INF][:] http client called
[2024-11-12 11:39:36,232][INF][:] Start processing HTTP request GET https://mobile-api-test.fleethd.com/v1.0/tenant/1/ext-rush_preview
[2024-11-12 11:39:36,233][INF][:] Sending HTTP request GET https://mobile-api-test.fleethd.com/v1.0/tenant/1/ext-rush_preview
[2024-11-12 11:39:36,716][INF][:] Received HTTP response headers after 476.05ms - 200
[2024-11-12 11:39:36,725][INF][:] End processing HTTP request after 491.099ms - 200
[2024-11-12 11:39:36,775][INF][:] http client called
[2024-11-12 11:39:36,782][INF][:] Start processing HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/msasetting
[2024-11-12 11:39:36,783][INF][:] Sending HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/msasetting
[2024-11-12 11:39:36,943][INF][:] Received HTTP response headers after 155.7728ms - 200
[2024-11-12 11:39:36,948][INF][:] End processing HTTP request after 165.8167ms - 200
[2024-11-12 11:39:36,999][INF][:] http client called
[2024-11-12 11:39:37,003][INF][:] Start processing HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/dasetting
[2024-11-12 11:39:37,004][INF][:] Sending HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/dasetting
[2024-11-12 11:39:37,12][INF][:] Received HTTP response headers after 114.5331ms - 200
[2024-11-12 11:39:37,124][INF][:] End processing HTTP request after 121.3646ms - 200
[2024-11-12 11:39:37,17][INF][:] http client called
[2024-11-12 11:39:37,175][INF][:] Start processing HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/versionsetting
[2024-11-12 11:39:37,176][INF][:] Sending HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/setting/versionsetting
[2024-11-12 11:39:37,261][INF][:] Received HTTP response headers after 83.5758ms - 200
[2024-11-12 11:39:37,263][INF][:] End processing HTTP request after 88.7605ms - 200
[2024-11-12 11:39:39,898][INF][:] http client called
[2024-11-12 11:39:39,91][INF][:] Start processing HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/vehiclestate/nearby/identity/-107.93973559481766/38.87430454620713/80.4672
[2024-11-12 11:39:39,912][INF][:] Sending HTTP request GET https://mobile-api-test.fleethd.com/v1.0/ext-rush_preview/vehiclestate/nearby/identity/-107.93973559481766/38.87430454620713/80.4672
[2024-11-12 11:39:40,068][INF][:] Received HTTP response headers after 155.1397ms - 200
[2024-11-12 11:39:40,07][INF][:] End processing HTTP request after 160.1551ms - 200
[2024-11-12 11:40:04,815][INF][AppRoutingService.cs:546] sleeping, so reset open analytics state
[2024-11-12 11:40:05,35][ERR][:] CRASH
ObjCRuntime.ObjCException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 810}, scale=2.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.
Native stack trace:
0 CoreFoundation 0x00000001916847d8 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 534488
1 libobjc.A.dylib 0x000000018e9572e4 objc_exception_throw + 88
2 Foundation 0x0000000190a54a78 6D0212CC-3B9E-32C9-BE20-72989CE3ACB8 + 8452728
3 UIKitCore 0x0000000193e9355c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 701788
4 FleetHDMobile 0x00000001034c195c FleetHDMobile + 9591132
5 FleetHDMobile 0x00000001037c2a30 AppleCryptoNative_X509ImportCertificate + 2881592
6 FleetHDMobile 0x00000001037b718c AppleCryptoNative_X509ImportCertificate + 2834324
7 FleetHDMobile 0x00000001037b4c4c AppleCryptoNative_X509ImportCertificate + 2824788
8 FleetHDMobile 0x00000001037838b4 AppleCryptoNative_X509ImportCertificate + 2623164
9 FleetHDMobile 0x000000010372bf08 AppleCryptoNative_X509ImportCertificate + 2264336
10 FleetHDMobile 0x000000010372ed40 AppleCryptoNative_X509ImportCertificate + 2276168
11 FleetHDMobile 0x00000001037f1d98 AppleCryptoNative_X509ImportCertificate + 3074976
12 FleetHDMobile 0x000000010382cfc4 AppleCryptoNative_X509ImportCertificate + 3317196
13 UIKitCore 0x0000000193e5844c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 459852
14 UIKitCore 0x0000000193ecdda0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 941472
15 UIKitCore 0x0000000193e6c9f8 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543224
16 UIKitCore 0x0000000193e6cafc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
17 UIKitCore 0x0000000193e6cafc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
18 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
19 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
20 UIKitCore 0x0000000193e6cafc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
21 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
22 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
23 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
24 UIKitCore 0x0000000193e6cba0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543648
25 UIKitCore 0x0000000193e6cafc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 543484
26 UIKitCore 0x0000000193e6c720 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 542496
27 UIKitCore 0x0000000193e6c618 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 542232
28 UIKitCore 0x0000000193df50c0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 53440
29 QuartzCore 0x000000019312bc28 D8E8E86D-85AC-3C90-B2E1-940235ECAA18 + 494632
30 UIKitCore 0x0000000193e38138 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 327992
31 UIKitCore 0x00000001949043ac __UIVIEWCONTROLLERTRANSITIONCOORDINATOR_IS_EXECUTING_ALONGSIDE_ANIMATION_BLOCK__ + 36
32 UIKitCore 0x00000001940cb648 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3028552
33 UIKitCore 0x00000001940cb518 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3028248
34 UIKitCore 0x0000000194919310 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 11735824
35 UIKitCore 0x0000000194301a50 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 5347920
36 UIKitCore 0x0000000193f5ee40 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1535552
37 UIKitCore 0x0000000193f5e308 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1532680
38 UIKitCore 0x0000000194148cec 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3542252
39 UIKitCore 0x0000000194148904 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3541252
40 UIKitCore 0x0000000193fbf34c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 1930060
41 UIKitCore 0x00000001941f4378 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4244344
42 UIKitCore 0x00000001941f4cd0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4246736
43 UIKitCore 0x00000001946131e0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8565216
44 UIKitCore 0x00000001941740ac 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 3719340
45 UIKitCore 0x0000000194613160 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8565088
46 UIKitCore 0x0000000193e67f30 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 524080
47 UIKitCore 0x000000019461220c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561164
48 UIKitCore 0x00000001946120fc 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8560892
49 UIKitCore 0x0000000194612340 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561472
50 UIKitCore 0x000000019513bc64 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 20266084
51 UIKitCore 0x0000000194f2b414 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18101268
52 UIKitCore 0x0000000194f2c610 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105872
53 FrontBoardServices 0x00000001aac7f088 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467080
54 FrontBoardServices 0x00000001aac7f0a4 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467108
55 FrontBoardServices 0x00000001aac7f0a4 D627737B-3C6C-3308-A90C-AD705542C2B3 + 467108
56 FrontBoardServices 0x00000001aac7eb1c D627737B-3C6C-3308-A90C-AD705542C2B3 + 465692
57 UIKitCore 0x0000000194f2c560 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105696
58 UIKitCore 0x0000000194f2be00 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18103808
59 UIKitCore 0x0000000194f2c410 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18105360
60 UIKitCore 0x0000000194612278 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561272
61 UIKitCore 0x0000000194612490 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 8561808
62 UIKitCore 0x0000000194f2c28c 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 18104972
63 UIKitCore 0x00000001953ef954 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 23099732
64 UIKitCore 0x00000001953ef7d0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 23099344
65 UIKitCore 0x0000000193ffe190 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2187664
66 UIKitCore 0x00000001940bd824 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2971684
67 UIKitCore 0x00000001940bd404 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 2970628
68 FrontBoardServices 0x00000001aac441bc D627737B-3C6C-3308-A90C-AD705542C2B3 + 225724
69 FrontBoardServices 0x00000001aac43d6c D627737B-3C6C-3308-A90C-AD705542C2B3 + 224620
70 FrontBoardServices 0x00000001aac133c8 D627737B-3C6C-3308-A90C-AD705542C2B3 + 25544
71 FrontBoardServices 0x00000001aac21db8 D627737B-3C6C-3308-A90C-AD705542C2B3 + 85432
72 FrontBoardServices 0x00000001aac21c44 D627737B-3C6C-3308-A90C-AD705542C2B3 + 85060
73 FrontBoardServices 0x00000001aac26114 D627737B-3C6C-3308-A90C-AD705542C2B3 + 102676
74 libdispatch.dylib 0x000000019935a0d0 7DE7EC03-CFB7-349D-9B9E-8782B38F231D + 16592
75 libdispatch.dylib 0x000000019935db14 7DE7EC03-CFB7-349D-9B9E-8782B38F231D + 31508
76 FrontBoardServices 0x00000001aac23300 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90880
77 FrontBoardServices 0x00000001aac23280 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90752
78 FrontBoardServices 0x00000001aac23158 D627737B-3C6C-3308-A90C-AD705542C2B3 + 90456
79 CoreFoundation 0x0000000191658328 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 353064
80 CoreFoundation 0x00000001916582bc 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 352956
81 CoreFoundation 0x0000000191655dc0 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 343488
82 CoreFoundation 0x0000000191654fbc 1532D3D8-9B3B-3F2F-B35F-55A20DDF411B + 339900
83 CoreFoundation 0x0000000191654830 CFRunLoopRunSpecific + 588
84 GraphicsServices 0x00000001dd6341c4 GSEventRunModal + 164
85 UIKitCore 0x00000001941baeb0 575E5140-FA6A-37C2-B00B-A4EACEDFDA53 + 4009648
86 UIKitCore 0x00000001942695b4 UIApplicationMain + 340
87 FleetHDMobile 0x00000001034d81f4 xamarin_UIApplicationMain + 60
88 FleetHDMobile 0x00000001037c3da4 AppleCryptoNative_X509ImportCertificate + 2886572
89 FleetHDMobile 0x00000001037c26a4 AppleCryptoNative_X509ImportCertificate + 2880684
90 FleetHDMobile 0x00000001037b70b4 AppleCryptoNative_X509ImportCertificate + 2834108
91 FleetHDMobile 0x00000001037b4c4c AppleCryptoNative_X509ImportCertificate + 2824788
92 FleetHDMobile 0x00000001037838b4 AppleCryptoNative_X509ImportCertificate + 2623164
93 FleetHDMobile 0x000000010372aff4 AppleCryptoNative_X509ImportCertificate + 2260476
94 FleetHDMobile 0x00000001037312f0 AppleCryptoNative_X509ImportCertificate + 2285816
95 FleetHDMobile 0x0000000103788ed0 AppleCryptoNative_X509ImportCertificate + 2645208
96 FleetHDMobile 0x00000001034ef2f0 xamarin_log + 22332
97 FleetHDMobile 0x00000001037f166c AppleCryptoNative_X509ImportCertificate + 3073140
98 dyld 0x00000001b7042ec8 3060D36A-16CE-3C3A-9258-3881459F5714 + 212680
at ObjCRuntime.Runtime.ThrowNSException(IntPtr ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 564
at UIKit.UIGraphics.BeginImageContextWithOptions(CGSize , Boolean , NFloat ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGraphics.cs:line 92
at Microsoft.Maui.Controls.Platform.BrushExtensions.GetBackgroundImage(UIView control, Brush brush)
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.UpdateBackground()
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.HandleShellPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.Shell.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.AppThemeBinding.<>c__DisplayClass11_0.<ApplyCore>g__Set|0()
at Microsoft.Maui.Controls.AppThemeBinding.ApplyCore(Boolean dispatch)
at Microsoft.Maui.Controls.AppThemeBinding.Apply(Boolean fromTarget)
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.OnAppThemeChanged()
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.<>c.<.cctor>b__8_0(BindableObject bindable, Object oldValue, Object newValue)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.TriggerThemeChangedActual()
at Microsoft.Maui.Controls.Application.set_PlatformAppTheme(AppTheme value)
at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.ThemeChanged()
at Microsoft.Maui.Platform.PageViewController.TraitCollectionDidChange(UITraitCollection previousTraitCollection)
__- End of stack trace from previous location __-
at UIKit.UIGraphics.BeginImageContextWithOptions(CGSize , Boolean , NFloat ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGraphics.cs:line 92
at Microsoft.Maui.Controls.Platform.BrushExtensions.GetBackgroundImage(UIView control, Brush brush)
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.UpdateBackground()
at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutContentRenderer.HandleShellPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.Shell.OnPropertyChanged(String propertyName)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.AppThemeBinding.<>c__DisplayClass11_0.<ApplyCore>g__Set|0()
at Microsoft.Maui.Controls.AppThemeBinding.ApplyCore(Boolean dispatch)
at Microsoft.Maui.Controls.AppThemeBinding.Apply(Boolean fromTarget)
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.OnAppThemeChanged()
at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.<>c.<.cctor>b__8_0(BindableObject bindable, Object oldValue, Object newValue)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e)
at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.OnParentResourcesChanged(IEnumerable`1 values)
at Microsoft.Maui.Controls.Application.TriggerThemeChangedActual()
at Microsoft.Maui.Controls.Application.set_PlatformAppTheme(AppTheme value)
at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.ThemeChanged()
at Microsoft.Maui.Platform.PageViewController.TraitCollectionDidChange(UITraitCollection previousTraitCollection)
__- End of stack trace from previous location __-
at UIKit.UIApplication.UIApplicationMain(Int32 , String[] , IntPtr , IntPtr ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 61
at UIKit.UIApplication.Main(String[] , Type , Type ) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 96
at FleetHDMobile.Program.Main(String[] args) in /Users/chuckkrutsinger/Blue_Dot_Repos/fleet-hd-mobile/src/FleetHDMobile/Platforms/iOS/Program.cs:line 16
The only line of our source in this trace is Program.cs line 16:
UIApplication.Main(args, null, typeof(AppDelegate));
So whatever is happening upon being backgrounded, is happening deep in Maui/Xamarin/Dotnet code. Somehow, UI Code is being triggered. The presence of AppleCrypto in the stack is also interesting. I wonder if that has to do with prefences, which I believe use encryption.
It may be this line: https://github.com/dotnet/maui/blob/c1bb5fd2801b5a65101e97e19295d31296174a83/src/Controls/src/Core/Platform/iOS/Extensions/BrushExtensions.cs#L124
However, the stack seems to indicate that this all starts with
at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.ThemeChanged()
at Microsoft.Maui.Platform.PageViewController.TraitCollectionDidChange(UITraitCollection previousTraitCollection)
It looks like the theme is changing in the background for some reason...
I wonder if you were to implement IApplication
on your app and then explicitly implement ThemeChanged
and make it do nothing:
class App : Application, IApplication
{
...
void IApplication.ThemeChanged(...)
{
// do nothing
}
}
@mattleibow That was it! I implemented IApplication
and logged it. It was being called multiple times during background.
void IApplication.ThemeChanged()
{
Log.Logger.Information("theme changing");
}
Output:
[2024-11-12 17:25:40,178][INF][:] app enters background
[2024-11-12 17:25:40,35][INF][:] theme changing
[2024-11-12 17:25:40,352][INF][:] theme changing
[2024-11-12 17:25:40,638][INF][:] theme changing
[2024-11-12 17:25:40,639][INF][:] theme changing
[2024-11-12 17:25:40,765][INF][:] theme changing
[2024-11-12 17:25:40,777][INF][:] theme changing
[2024-11-12 17:25:40,867][INF][:] theme changing
[2024-11-12 17:25:40,868][INF][:] theme changing
[2024-11-12 17:27:03,773][INF][:] resuming foreground
So how can I block these only while in background? Or is there something in my code causing all these events to fire?
@mattleibow If I implement Application.ThemeChanged()
and do nothing, then theme changes are blocked while in the foreground as well. Is there some way to let them through when in the foreground?
void IApplication.ThemeChanged()
{
if (isInBackground)
return;
// do something here to allow normal processing of theme changes
}
This repo has a simple project to reproduce the crash on backgrounding: https://github.com/ksoftllc/CrashOnBackgroundIos
You can let them through by doing this:
void IApplication.ThemeChanged()
{
if (isInBackground)
return;
PlatformAppTheme = AppInfo.RequestedTheme;
}
@mattleibow
Everything I have tried is read only.
Description [UPDATED]
When our MAUI app for iOS is run on iPad, it crashes a few seconds after being backgrounded by pressing home button. Interestingly, this doesn't happen on iPhone.
To recreate the crash, I had to add a TabBar to the AppShell.xaml in the MAUI Hello World project.
The cause appears to be receiving theme change events while in the background. Oddly, I do not need to do any theme changes to cause the crash. @mattleibow identified the crash site in his analysis below.
Steps to Reproduce
Launch app on iPad.
Press home button.
Wait about 2 or 3 seconds.
Return to the app, it will have crashed.
Link to public reproduction project repository
https://github.com/ksoftllc/CrashOnBackgroundIos
Version with bug
8.0.91 SR9.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
iOS
Affected platform versions
17.x and 18.1
Did you find any workaround?
No workaround
Relevant log output
Here is the symbolicated crash log:
I don't see anything here from our source code, but would love some help interpreting this.