You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
Native iOS device debugging with the mono interpreter enabled can lead to asserts in mono. See mono/mono#19899. While this isn't an XF issue specifically, the mono bug can be partially worked around by changing XF code.
MonoAssertWorkaround.patch (yes a patch - a 7 byte deletion is trivial and not worth any arbitrary PR barriers, sorry)
diff --git "a/Xamarin.Forms.Platform.iOS/Forms.cs" "b/Xamarin.Forms.Platform.iOS/Forms.cs"
index 643fdacb7..6b8ee58ab 100644
--- "a/Xamarin.Forms.Platform.iOS/Forms.cs"
+++ "b/Xamarin.Forms.Platform.iOS/Forms.cs"
@@ -302,7 +302,7 @@ namespace Xamarin.Forms
public void BeginInvokeOnMainThread(Action action)
{
- NSRunLoop.Main.BeginInvokeOnMainThread(action.Invoke);
+ NSRunLoop.Main.BeginInvokeOnMainThread(action);
}
public Ticker CreateTicker()
Steps to Reproduce
See attached repro sample below with notes of small edits required.
Expected Behavior
Debugging works without mono asserts.
Actual Behavior
Mono asserts.
Basic Information
Version with issue: ALL
Last known good version: NONE
Platform Target Frameworks:
iOS: 14.3.1
Android: N/A
UWP: N/A
Android Support Library / AndroidX Version: N/A
NuGet Packages: None
Affected Devices: All arm64 devices
Environment
Show/Hide Visual Studio info
Microsoft Visual Studio Professional 2022
Version 17.6.5
Build Logs
N/A
Screenshots
N/A
Reproduction Link
While the repro isn't an XF example natively, one can add the XF nuget package, add the XF Init call and replace the AppDelegate.cs:DeviceBeginInvokeOnMainThread method in the sample with XF's Device.BeginInvokeOnMainThread.
Description
Native iOS device debugging with the mono interpreter enabled can lead to asserts in mono. See mono/mono#19899. While this isn't an XF issue specifically, the mono bug can be partially worked around by changing XF code.
The proposed workaround is to drop the unnecessary
.Invoke
here Xamarin.Forms.Platform.iOS/Forms.cs#L305MonoAssertWorkaround.patch (yes a patch - a 7 byte deletion is trivial and not worth any arbitrary PR barriers, sorry)
Steps to Reproduce
See attached repro sample below with notes of small edits required.
Expected Behavior
Debugging works without mono asserts.
Actual Behavior
Mono asserts.
Basic Information
Environment
Show/Hide Visual Studio info
Build Logs
N/A
Screenshots
N/A
Reproduction Link
While the repro isn't an XF example natively, one can add the XF nuget package, add the XF Init call and replace the AppDelegate.cs:DeviceBeginInvokeOnMainThread method in the sample with XF's Device.BeginInvokeOnMainThread.
https://github.com/mono/mono/files/12180840/XMI8731_M19899.zip
Workaround
Don't use Device.BeginInvokeOnMainThread or variants that call into IOSPlatformServices.BeginInvokeOnMainThread.
The text was updated successfully, but these errors were encountered: