-
Notifications
You must be signed in to change notification settings - Fork 549
Closed
Labels
bugIf an issue is a bug or a pull request a bug fixIf an issue is a bug or a pull request a bug fixregressionThe issue or pull request is a regressionThe issue or pull request is a regression
Milestone
Description
Apple platform
iOS
Framework version
net9.0-*
Affected platform version
.NET 9.0.303 (workload 9.0.303.1), iOS workload 18.5.9214, iPhone SE, iOS 18.6
Description
This seems to be at least similar to 21648. I see this exception sometimes when backgrounding and resuming the app on iOS. Unfortunately, I am unable to get a full stack trace.
ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x13755b200 (type: Microsoft_Maui_Platform_MauiTextField). 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.MauiTextField' does not have a constructor that takes one NativeHandle argument).
Steps to Reproduce
- Add the following code at the start of
AppDelegate.FinishedLaunchingto increase the likelihood of the bug occurring.
var thread = new Thread ((v) => {
while (true) {
Thread.Sleep (1000);
GC.Collect ();
}
});
thread.IsBackground = true;
thread.Start ();
- Create memory pressure. In my case this means forcing the app to process a lot of test data at high speed.
- Visit a page with an
Entrycontrol, anything backed byMauiTextField. - Focus the control.
- Exit the page.
- Immediately, background and reopen the app.
- Observe crash when app tries to reopen.
Did you find any workaround?
I have implemented a workaround based on the one mentioned here.
Relevant logs
No response
sven-s, Serdar17, tipa, DigitApps2, BioTurboNick and 1 more
Metadata
Metadata
Assignees
Labels
bugIf an issue is a bug or a pull request a bug fixIf an issue is a bug or a pull request a bug fixregressionThe issue or pull request is a regressionThe issue or pull request is a regression