MAUI - 10.0.51 - 10.0.60 - *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException' #35580
Replies: 2 comments 26 replies
|
Crash log> |
|
Minimal repro attached + root-cause analysis Attached a minimal repro (dotnet new maui + 4 files). It's a CollectionView whose The exception message points at a lifetime race, not a logic bug: "Could not find an existing managed instance for this object, nor was it possible iOS still holds the native LayoutView, but its managed peer has been GC'd because the This works on 10.0.51 and regresses somewhere in 10.0.52-10.0.60, and overlaps with @rolfbjarne with the repro in hand, would someone on the runtime/marshaling side be |
Uh oh!
There was an error while loading. Please reload this page.
After upgrading to MAUI 10.0.60 from 10.0.51, the app crashes often with the message bellow. Upgrade to 10.0.70 does not solve it. Looks like something in 10.0.51 to 10.0.60.
*** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to marshal the Objective-C object 0x11e74ebc0 (type: Microsoft_Maui_Platform_LayoutView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Microsoft.Maui.Platform.LayoutView' does not have a constructor that takes one NativeHandle argument). (ObjCRuntime.RuntimeException)What I have found out is, that it works the first time. After killing the app, starting the app again, the error occurs.
I have pin pointed the error to XAML, in collectionView, Template host which is inside 'ItemTemplate'.
This 'Right' can be null, which means empty content.
If I remove this, it starts to work.
I have also tried to programmatically add this to collectionView and it works, if I do not add 'TemplateHost' if the Right is null.
Resources:
I have tried adding 'CustomView', but it does not help.
The log also shows 'ValidateSafeArea', was testing with SafeAreaEdges='none', but it does not work either.
Full log:
All reactions