Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI Blazor app crashes during startup on MacBook M1 #20426

Closed
d3lboy opened this issue Feb 7, 2024 · 4 comments
Closed

MAUI Blazor app crashes during startup on MacBook M1 #20426

d3lboy opened this issue Feb 7, 2024 · 4 comments
Labels
platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working

Comments

@d3lboy
Copy link

d3lboy commented Feb 7, 2024

Description

I have created an app (hybrid/Blazor) for Windows and Mac using maccatalys. Maccatalyst app works properly on x64, but not on M1 chip. I have tested with MacBook Air M1, OS version 13.2.1.
SupportedOSPlatformVersion for maccatalyst is 14.0.

On M1 chip, it crashes on startup. I have attached these console logs, but I can't find anything valuable there (lack of knowledge reading those Apple creepy logs).

With AppDomain.CurrentDomain.FirstChanceException I got this:

ObjCRuntime.ObjCException: Objective-C exception thrown.  Name: NSUnknownKeyException Reason: [<WKWebView 0x156f29a00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inspectable.
Native stack trace:
	0   CoreFoundation                      0x00000001afa183e8 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x00000001af562ea8 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001afa41800 _CFBundleGetValueForInfoKey + 0
	3   Foundation                          0x00000001b087b0e4 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 364
	4   UIKitCore                           0x00000001d9c0a1d0 -[UIView(CALayerDelegate) setValue:forKey:] + 160
	5   Bookerei                            0x00000001048b2f00 xamarin_dyn_objc_msgSend + 160
	6   Bookerei                            0x0000000104c13214 do_icall + 244
	7   Bookerei                            0x0000000104c11ae0 do_icall_wrapper + 356
	8   Bookerei                            0x0000000104c06508 mono_interp_exec_method + 2784
	9   Bookerei                            0x0000000104c040dc interp_runtime_invoke + 244
	10  Bookerei                            0x0000000104b4d018 mono_jit_runtime_invoke + 1140
	11  Bookerei                            0x0000000104af20b0 mono_runtime_try_invoke + 156
	12  Bookerei                            0x0000000104af4dfc mono_runtime_invoke + 516
	13  Bookerei                            0x00000001048b11ec xamarin_invoke_trampoline + 3636
	14  Bookerei                            0x00000001048b2788 xamarin_arch_trampoline + 68
	15  Bookerei                            0x00000001048b2dd4 xamarin_arm64_common_trampoline + 64
	16  UIKitCore                           0x00000001d9a54b10 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 296
	17  UIKitCore                           0x00000001d9a53fc8 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2820
	18  UIKitCore                           0x00000001d9a5229c -[UIApplication _runWithMainScene:transitionContext:completion:] + 988
	19  UIKitCore                           0x00000001d9a51dd0 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 108
	20  UIKitCore                           0x00000001d9a4e9a4 _UIScenePerformActionsWithLifecycleActionMask + 108
	21  UIKitCore                           0x00000001d9a5171c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216
	22  UIKitCore                           0x00000001d9a514a0 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 332
	23  UIKitCore                           0x00000001d9a50a38 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 624
	24  UIKitCore                           0x00000001d9a50724 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252
	25  UIKitCore                           0x00000001d9a4ef80 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148
	26  UIKitCore                           0x00000001da195308 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736
	27  UIKitCore                           0x00000001da26870c _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224
	28  UIKitCore                           0x00000001d9a4eb2c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316
	29  UIKitCore                           0x00000001d9cb46d4 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.231 + 556
	30  UIKitCore                           0x00000001d9a4dfd0 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216
	31  UIKitCore                           0x00000001d9a4de40 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244
	32  UIKitCore                           0x00000001d9a43fd8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 520
	33  UIKitCore                           0x00000001d9a43d58 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288
	34  FrontBoardServices                  0x00000001c2dcdce8 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 372
	35  FrontBoardServices                  0x00000001c2df13ac __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.102 + 120
	36  FrontBoardServices                  0x00000001c2dbc90c -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 196
	37  FrontBoardServices                  0x00000001c2df0fc0 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 356
	38  libdispatch.dylib                   0x00000001af736504 _dispatch_client_callout + 20
	39  libdispatch.dylib                   0x00000001af739f84 _dispatch_block_invoke_direct + 264
	40  FrontBoardServices                  0x00000001c2dbc820 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
	41  FrontBoardServices                  0x00000001c2e0b5c4 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220
	42  FrontBoardServices                  0x00000001c2dbc7c0 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
	43  CoreFoundation                      0x00000001af99da08 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
	44  CoreFoundation                      0x00000001af99d99c __CFRunLoopDoSource0 + 176
	45  CoreFoundation                      0x00000001af99d70c __CFRunLoopDoSources0 + 244
	46  CoreFoundation                      0x00000001af99c310 __CFRunLoopRun + 836
	47  CoreFoundation                      0x00000001af99b878 CFRunLoopRunSpecific + 612
	48  HIToolbox                           0x00000001b907bfa0 RunCurrentEventLoopInMode + 292
	49  HIToolbox                           0x00000001b907bc30 ReceiveNextEventCommon + 236
	50  HIToolbox                           0x00000001b907bb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
	51  AppKit                              0x00000001b2c2184c _DPSNextEvent + 632
	52  AppKit                              0x00000001b2c209dc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
	53  AppKit                              0x00000001b2c14e0c -[NSApplication run] + 464
	54  AppKit                              0x00000001b2bec250 NSApplicationMain + 880
	55  AppKit                              0x00000001b2e46710 +[NSWindow _savedFrameFromString:] + 0
	56  UIKitMacHelper                      0x00000001c5f36b04 UINSApplicationMain + 988
	57  UIKitCore                           0x00000001d9a2c0fc UIApplicationMain + 148
	58  Bookerei                            0x00000001048a81d0 xamarin_UIApplicationMain + 24
	59  Bookerei                            0x0000000104c1325c do_icall + 316
	60  Bookerei                            0x0000000104c11ae0 do_icall_wrapper + 356
	61  Bookerei                            0x0000000104c06508 mono_interp_exec_method + 2784
	62  Bookerei                            0x0000000104c040dc interp_runtime_invoke + 244
	63  Bookerei                            0x0000000104b4d018 mono_jit_runtime_invoke + 1140
	64  Bookerei                            0x0000000104af1188 mono_runtime_invoke_checked + 148
	65  Bookerei                            0x0000000104af720c mono_runtime_exec_main_checked + 116
	66  Bookerei                            0x0000000104b9f988 mono_jit_exec + 364
	67  Bookerei                            0x00000001048b26e0 xamarin_main + 544
	68  Bookerei                            0x0000000104c40840 main + 64
	69  dyld                                0x00000001af593e50 start + 2544

Not sure, but seems that MAUI tries to manipulate with WebView and it fails and crashes the app.
crashreport.txt

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

maccatalyst-arm64

Did you find any workaround?

No response

Relevant log output

No response

@d3lboy d3lboy added the t/bug Something isn't working label Feb 7, 2024
@MeestorX
Copy link

MeestorX commented Feb 7, 2024

Maybe the same issue as this?

@Eilon
Copy link
Member

Eilon commented Feb 7, 2024

Maybe the same issue as this?

Yup I think that's exactly it.

@Eilon Eilon closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2024
@d3lboy
Copy link
Author

d3lboy commented Feb 8, 2024

Thanks for fast response.
As I understood, the only way is to target maccatalyst 16.6 (macOS 13.5+).
It would be nice to know if it is going to be included into future .net8 releases and when.

@Eilon
Copy link
Member

Eilon commented Feb 9, 2024

For anyone running into this issue, I might have figured out a workaround that you can apply to affected apps: #19613 (comment)

(Or, we will have a patch for .NET 8 that will go out, if you are able to wait.)

@samhouts samhouts added the platform/macOS 🍏 macOS / Mac Catalyst label Feb 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants