-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Border: PlatformView cannot be null here | Happens randomly in release builds. #27194
Comments
@jsuarezruiz @StephaneDelcroix I'm curious about the implementation of StrokeShape on Border I feel like we've talked about this a little bit at some point. The code here is using But in border we're adding the stroke shape as a logical child maui/src/Controls/src/Core/Border/Border.cs Lines 61 to 79 in 4a36584
This is something that we "fixed" at one point but had to revert wasn't it? |
This issue occurs randomly, and I can only identify it through Sentry from release builds. As a result, creating a reproducible project is not possible. |
Tried to reproduce here 39d78e7 without luck so far. I guess could be related with a DynamicResource, a StrokeShape property invalidation and maybe a navigation back where the PlatformView is already disposed (NRE). Will try to reproduce adding navigation options to the sample. |
Yea, we're in a bit of an unfortunate space right now with StrokeShape I would say that you can't currently make StrokeShape a staticresource Pinging @StephaneDelcroix for additional ideas here |
@PureWeen Thanks for letting us know. As a workaround ,we’re planning to use a custom border that extends Border, and we’ll handle the styling in the constructor. |
StrokeShape is an element, need to be parented, and so can't be a StaticResource, as StaticResource are shared by instance. we need to implement x:Shared for resources. |
Description
We are encountering a random issue in our .NET MAUI [.NET 8] application(only targets android) in release builds where an
System.InvalidOperationException
is being thrown.Although the exception occurs randomly in different parts of the app, the stack trace in Sentry consistently points to the Stroke Shape mapper method in the MAUI source code. This may be due to the way we defined our Border Styles.
This leads us to believe the issue might originate from the MAUI framework itself.
Here's are couple of stack trace's i get from sentry
Stack Trace 1
Stack Trace 2
The exception is always thrown during page initialization, specifically from
InitializeComponent().
as indicated in the stack traces.We have style's defined for
Border
inApp.xaml
, something like belowWe are applying these style's either as
Style={StaticResource BorderStyle}
orStyle = {DynamicReosource BorderStyle}
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.93 SR9.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: