0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:13,5 C#
0x22 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:357,26 C#
0x1 in Microsoft.Maui.Graphics.Platform.GraphicsExtensions.AsColor at D:\a\_work\1\s\src\Graphics\src\Graphics\Platforms\Android\GraphicsExtensions.cs:28,4 C#
0x1 in Microsoft.Maui.Platform.ColorExtensions.ToPlatform at D:\a\_work\1\s\src\Core\src\Platform\Android\ColorExtensions.cs:14,55 C#
0x29 in Microsoft.Maui.Graphics.MauiDrawable.GetGradientPaintData at D:\a\_work\1\s\src\Core\src\Graphics\MauiDrawable.Android.cs:610,5 C#
0x35 in Microsoft.Maui.Graphics.MauiDrawable.SetLinearGradientPaint at D:\a\_work\1\s\src\Core\src\Graphics\MauiDrawable.Android.cs:554,4 C#
0xD in Microsoft.Maui.Graphics.MauiDrawable.SetPaint at D:\a\_work\1\s\src\Core\src\Graphics\MauiDrawable.Android.cs:539,5 C#
0x3A in Microsoft.Maui.Graphics.MauiDrawable.SetBackground at D:\a\_work\1\s\src\Core\src\Graphics\MauiDrawable.Android.cs:527,6 C#
0x180 in Microsoft.Maui.Graphics.MauiDrawable.OnDraw at D:\a\_work\1\s\src\Core\src\Graphics\MauiDrawable.Android.cs:438,6 C#
0x24 in Android.Graphics.Drawables.ShapeDrawable.n_OnDraw_Landroid_graphics_drawable_shapes_Shape_Landroid_graphics_Canvas_Landroid_graphics_Paint_ at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Graphics.Drawables.ShapeDrawable.cs:428,4 C#
0xD in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:356,5 C#
Steps to Reproduce
This one is complex:
Set up a Grid with a LinearGradientBrush where one of the GradientStop's colors is bound to a property
Set up a TouchBehavior on that grid and register for the long press event
During the long press event, call Activity.StartSupportActionMode()
In ActionMode.ICallback.OnCreateActionMode, change the Grid's background to a SolidColorBrush
In ActionMode.ICallback.OnDestroyActionMode, set the Grid's background back to the original brush
Do this twice. The second time, the NullReferenceException will be thrown
Or run the repro I provided, and:
Long press on the aqua-colored "welcome" text; it will turn green.
Description
The NRE in question:
Steps to Reproduce
This one is complex:
Or run the repro I provided, and:
Link to public reproduction project repository
https://github.com/mfeingol/repros/tree/master/BackgroundColorCrashRepro
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
14
Did you find any workaround?
No.
Relevant log output
No response