yurkinh / Plugin.Maui.Calendar

.NET MAUI port of XF calendar plugin
MIT License
103 stars 10 forks source link

iOS Crash when you dismiss your app (nullref) #67

Open edgiardina opened 1 month ago

edgiardina commented 1 month ago

I get Object reference not set to an instance of an object. when my app is dismissed on iOS using an upswipe when on a page that displays the calendar.

at Plugin.Maui.Calendar.Controls.MonthDaysView.UpdateDaysColors() at Plugin.Maui.Calendar.Controls.MonthDaysView.OnPropertyChanged(String propertyName) at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent) at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity) at Microsoft.Maui.Controls.BindingExpression.ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget, SetterSpecificity specificity) at Microsoft.Maui.Controls.BindingExpression.Apply(Boolean fromTarget) at Microsoft.Maui.Controls.BindingExpression.BindingExpressionPart.b50_0() at Microsoft.Maui.Controls.DispatcherExtensions.DispatchIfRequired(IDispatcher dispatcher, Action action) at Microsoft.Maui.Controls.BindingExpression.BindingExpressionPart.PropertyChanged(Object sender, PropertyChangedEventArgs args) at Microsoft.Maui.Controls.BindingExpression.WeakPropertyChangedProxy.OnPropertyChanged(Object sender, PropertyChangedEventArgs e) at Microsoft.Maui.Controls.BindableObject.OnPropertyChanged(String propertyName) at Microsoft.Maui.Controls.Element.OnPropertyChanged(String propertyName) at Plugin.Maui.Calendar.Controls.Calendar.OnPropertyChanged(String propertyName) at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent) at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity) at Microsoft.Maui.Controls.AppThemeBinding.<>c__DisplayClass11_0.gSet|0() at Microsoft.Maui.Controls.AppThemeBinding.ApplyCore(Boolean dispatch) at Microsoft.Maui.Controls.AppThemeBinding.Apply(Boolean fromTarget) at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.OnAppThemeChanged() at Microsoft.Maui.Controls.AppThemeBinding.AppThemeProxy.<>c.<.cctor>b__8_0(BindableObject bindable, Object oldValue, Object newValue) at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent) at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity) at Microsoft.Maui.Controls.Element.OnResourceChanged(BindableProperty property, Object value, SetterSpecificity specificity) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.VisualElement.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(Object sender, ResourcesChangedEventArgs e) at Microsoft.Maui.Controls.Element.OnResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Element.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Application.OnParentResourcesChanged(IEnumerable1 values) at Microsoft.Maui.Controls.Application.TriggerThemeChangedActual() at Microsoft.Maui.Controls.Application.set_PlatformAppTheme(AppTheme value) at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.ThemeChanged() at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.TraitCollectionDidChange(UITraitCollection previousTraitCollection) at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 58 at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94 at Ifpa.Program.Main(String[] args) in C:\Users\ed_gi\source\repos\IfpaMaui\Platforms\iOS\Program.cs:line 13

yurkinh commented 1 month ago

Hi @edgiardina As a temporary workaround I would suggest downgrading to version 1.1.6 while I'm working on a solution for this issue. It's related to an events unsubscription that was changed.

yurkinh commented 2 weeks ago

Hi @edgiardina Check please version 1.1.9

edgiardina commented 2 weeks ago

Thanks! I no longer receive the exception. However I am seeing missing numbers in the calendar on iOS which I've seen for a bit now. image

yurkinh commented 1 week ago

Hi @edgiardina Check please new v 1.2.0 Could you please provide a repro sample?

edgiardina commented 1 week ago

The new version unfortunately does not fix the missing numbers bug.

https://github.com/edgiardina/IfpaMaui (see the calendarviewmodel)

My repo shows the use case, although my repo isn't straight up runnable without a few api keys.

The issue is very reproducible. View a page with the calendar, swipe up to select a different app, come back and the numbers have disappeared.

yurkinh commented 1 week ago

Hi @edgiardina I was not able to run this app because of missing key. Could you please extract it to some blank app with simple steps to reproduce it?

edgiardina commented 1 week ago

https://github.com/edgiardina/PluginMauiCalendar-67-repro

Here is the repro repo, along with a video of the behavior and way to trigger it. as you can see, the text is white on initial load but when you press home it goes black. which is invisible on my layout's background but I made it purple here https://github.com/yurkinh/Plugin.Maui.Calendar/assets/3627193/6c353c71-210d-4ad8-8c74-f95df7ddbb85