Border: PlatformView cannot be null here | Happens randomly in release builds. #27194
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
platform/android 🤖
s/needs-repro
Attach a solution or code which reproduces the issue
t/bug
Something isn't working
Milestone
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: