-
Notifications
You must be signed in to change notification settings - Fork 517
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
Microsoft.Maui.Controls.Maps crash when IsShowingUser = true in Release mode (iOS, NET 9 rc2) #21759
Comments
From @mattleibow on Mon, 11 Nov 2024 15:42:57 GMT Is this just Release mode or also in Debug? |
From @MichelePannacciTerex on Mon, 11 Nov 2024 17:07:09 GMT
Hi, just tried and it crash also in Debug mode. In release the issue appear immediate while in debug you have to play zooming into the map a little more, not sure why. anyway yes. EDIT |
From @QwertyMC on Wed, 13 Nov 2024 03:49:41 GMT I am also seeing this issue where map loads fine until your location comes into view on the map, then the crash occurs. Setting IsShowingUser = False, stops the issue but clearly not a valid workaround. |
From @eerojaaskelainen on Thu, 21 Nov 2024 09:18:06 GMT Can affirm this. Although stack trace is pointing towards annotation creation (MKMapViewDelegate_GetViewForAnnotation) (custom) map pins are displayed correctly. It's only the user location pointer that crash the app. |
From @kaniosm on Thu, 21 Nov 2024 11:12:08 GMT I'm facing a similar issue (see here: dotnet/maui#26000). // https://bugzilla.xamarin.com/show_bug.cgi?id=26416 |
From @MichelePannacciTerex on Thu, 21 Nov 2024 11:27:08 GMT
Maybe because the user location should be MKMarkerAnnotationView... as it says invalid cast... |
Adding this to the csproj works around the bug: <PropertyGroup>
<Registrar>static</Registrar>
</PropertyGroup> |
…ocol. Fixes #21759. It's important that MKUserLocation class implements the IMKAnnotation interface, because a MKUserLocation instance might be passed as a parameter to a function that takes an IMKAnnotation. If the managed class doesn't implement the interface, this can result in an InvalidCastException at runtime. Fixes #21759.
This workaround doesn't seem to work for me, it crashes my app:
|
Tested on iPad 10th, iPhone 16 and iPhone 8. Everythings works, thanks! |
This is a workaround, a proper fix which won't require the workaround is in progress. |
Understood, btw, unexpectedly, looks like it solved for me a problem with a devexpress control. Shall report to them.. |
Following this as i am seeing this issue also |
Yes, for me the same issue. |
From @MichelePannacciTerex on Sun, 10 Nov 2024 17:30:09 GMT
Description
I'm expercienced a crash in the map control in Release mode on real device only if IsShowingUser = true while zooming/pinching on the map.
Unhandled managed exception: Arg_InvalidCastException (System.InvalidCastException)
Tried both Microsoft.Maui.Controls.Maps version 9.0.0-rc.2.24503.2 and the latest ones 8.0.92 and 8.0.93 but all of them has the same problem. This used to work using .NET 8, at least on iOS 17.x.
Steps to Reproduce
Attached a simple project, apparently no special things to do other than set IsShowingUser = true to reproduce the error.
This on real device.
P.S. in the .csproj you have to adjust the CodesignKey.
TestMap.zip
Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 18, iOS 18.1 NET 9 rc2
Did you find any workaround?
Not really a workaround but just adding a Circle to the map and polling the position my self.
Relevant log output
Copied from original issue dotnet/maui#25762
The text was updated successfully, but these errors were encountered: