Welcome to the Xamarin.Forms feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Forms, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

2
Votes

SfScheduler page is crashing my app once it appears. i am using android 10 device. 

private async void InitializeSchedule()
        {
            try
            {
                Application.Current.MainPage.IsBusy = true;
                Application.Current.MainPage.IsEnabled = false;
                var result = await App.chatService.ReadSchedule();
                viewModel = new SchedulePageViewModel();
                viewModel.Parse(result);
                schedule = new SfSchedule();
                schedule.MonthInlineAppointmentTapped += Schedule_MonthInlineAppointmentTapped;
                schedule.ShowResourceView = true;
                schedule.ScheduleView = ScheduleView.MonthView;
                schedule.AppointmentMapping = new ScheduleAppointmentMapping
                {
                    SubjectMapping = "Subject",
                    ColorMapping = "Color",
                    StartTimeMapping = "StartTime",
                    EndTimeMapping = "EndTime",
                    ResourceIdsMapping = "ResourceIds",
                    RecurrenceRuleMapping = "RecurrenceRule",
                };
                schedule.ResourceMapping = new ResourceMapping
                {
                    Name = "Name",
                    Id = "ID",
                    Color = "Color",
                };
                schedule.MonthViewSettings.ShowAgendaView = true;
                schedule.ResourceViewSettings.SelectionMode = Syncfusion.SfSchedule.XForms.SelectionMode.Multiple;
                this.schedule.SuspendAppointmentUpdate();
                schedule.DataSource = viewModel.Appointments;
                schedule.ScheduleResources = viewModel.Resources;
                schedule.SelectedResources = viewModel.SelectedResources;
                this.schedule.ResumeAppointmentUpdate();
                MainThread.BeginInvokeOnMainThread(() =>
                {
                    scheduleView.Content = schedule;
                });
            }
            catch (Exception ex)
            {
                var action = await this.DisplayActionSheet("Error", "Cancel", ex.Message, "Retry");
                if (action == "Retry")
                {
                    InitializeSchedule();
                }
            }
            finally
            {
                Application.Current.MainPage.IsBusy = false;
                Application.Current.MainPage.IsEnabled = true;
            }
        }

i am calling this method from SchedulePage_Appearing event of this page. and sometimes not always. it crashes my app after appearing. with this error

msg: android.runtime.JavaProxyThrowable: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <45fb8fb0007e43838318c5766136e6bd>:0 
  at Com.Syncfusion.Schedule.AppointmentEngine.GetVisibleAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] visibleDateRange, Com.Syncfusion.Schedule.ScheduleAppointmentCollection appointments, System.Boolean isTimelineView, System.Boolean isLeftsideResource) [0x0000e] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at Com.Syncfusion.Schedule.SfSchedule.<UpdateResourceAppointments>b__323_0 () [0x00042] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
--- End of stack trace from previous location where exception was thrown ---

  at Com.Syncfusion.Schedule.SfSchedule.UpdateResourceAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] resourceIDColl) [0x000ac] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
  at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr)
stacktrace: android.runtime.JavaProxyThrowable: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <45fb8fb0007e43838318c5766136e6bd>:0 
  at Com.Syncfusion.Schedule.AppointmentEngine.GetVisibleAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] visibleDateRange, Com.Syncfusion.Schedule.ScheduleAppointmentCollection appointments, System.Boolean isTimelineView, System.Boolean isLeftsideResource) [0x0000e] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at Com.Syncfusion.Schedule.SfSchedule.<UpdateResourceAppointments>b__323_0 () [0x00042] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
--- End of stack trace from previous location where exception was thrown ---

  at Com.Syncfusion.Schedule.SfSchedule.UpdateResourceAppointments (System.Collections.ObjectModel.ObservableCollection`1[T] resourceIDColl) [0x000ac] in <36a3cbfd8a6f4836a968c5a776f3511a>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <9a7f37f8b53d493eb264b2e0d3b2956a>:0 
  at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <985f5179c1dd4b3b98fb1b8dcc1ee9be>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr)
	at mono.java.lang.RunnableImplementor.n_run(Native Method)
	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7356)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
can you help please?