SF Combobox throws TaskSchedulerOnUnobservedTaskException and crashes if filter is enabled.

Hi Team,


My Android application crashes on pages where sfCombobox is used with filters enabled. While the exception is not thrown to the user or caught in the exception handler, the application crashes and with a 'Not responding' message. Below is the Android log written by the application for the same. This happens with both 'Starts with' and 'Contains' modes. The problem is could not be reproduced on any device and happens intermittently. The frequency too is very random. It may happen too many times on one day and doesn't happen for days together.

Android Log:

"TaskSchedulerOnUnobservedTaskException ---> System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (The operation was canceled.) ---> System.OperationCanceledException: The operation was canceled.

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: at System.Threading.CancellationToken.ThrowOperationCanceledException () [0x00010] in <ba8a5b1a17d54dd9a013269b2c8fadf9>:0

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: at System.Threading.CancellationToken.ThrowIfCancellationRequested () [0x00008] in <ba8a5b1a17d54dd9a013269b2c8fadf9>:0

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: at Syncfusion.Android.ComboBox.SfComboBox+<>c__DisplayClass655_1.<ContainswithDynamic>b__1 () [0x00035] in <29f024c4e2c44ee694f774161e2be9d4>:0

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <ba8a5b1a17d54dd9a013269b2c8fadf9>:0

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: at System.Threading.Tasks.Task.Execute () [0x00000] in <ba8a5b1a17d54dd9a013269b2c8fadf9>:0

02-04 10:07:56.070 10280 6776 6806 E SFA Crash report: --- End of inner exception stack trace ---"


Need a solution or a work around very urgently as the users are experiencing too frequently. 


Thanks


Santhosh


5 Replies

KP Kamalesh Periyasamy Syncfusion Team April 3, 2025 01:51 PM UTC

Hi Santhosh, 
 
Thank you for reaching out to us. To investigate this issue more effectively, could you please confirm whether you are using .NET MAUI or Xamarin? The thread is categorized under .NET MAUI, but we want to ensure we are addressing it correctly. Additionally, it would be extremely helpful if you could provide a reproducible sample demonstrating the issue. If possible, please also share the following details: 

  • Whether you are using custom filtering or the built-in filtering feature. 
  • Any specific configurations or data sources you are using with SfComboBox. 
  • The Android OS version and device details where you have observed this behavior. 

 
Since the issue occurs intermittently, any additional patterns or observations you have noted would also be valuable. We understand the urgency of this and will prioritize our investigation based on the details you provide. 
 
Looking forward to your response. 
 
Regards, 
Kamalesh P 



SK Santhosh Kumar replied to Kamalesh Periyasamy April 4, 2025 04:51 AM UTC

Hi Kamalesh,


Thanks for understanding the critical nature of the problem.


  1. This is happening in MAUI. 
  2. Android version is 14.
  3. I'm using standard filtering option with both 'starts with' and 'contains' search mode.
  4. Datasource is a list<T>. T contains two properties Key (string) and value (long)
  5. I have given the sample code used in the application. But I have not been able to reproduce this even once in the development environment or even while running the deployed apk on a couple of test devices. Infact the problem was discovered only by looking at the Android and application logs. The device used is Samsung A9+ 5G. We haven't been able to test this on other devices.

Sample code:
XAML:

  <editors:SfComboBox x:Name="cboproduct" DropDownItemFontFamily="poppinslight.ttf#poppinslight"

           Grid.Column="5" Grid.Row="3" Grid.ColumnSpan="2"

           DisplayMemberPath="Key" IsEnabled="True" IsClearButtonVisible="True"

            WidthRequest="400" IsEditable="True" IsFilteringEnabled="True" SelectionTextHighlightColor="Transparent"

                           Placeholder="Type here to filter product's name"

           SelectedItem="Binding {Value}, Mode=TwoWay" TextSearchMode="Contains"

            HorizontalOptions="FillAndExpand" DropDownItemHeight="30"

                       Style="{StaticResource ComboBoxStyle}"

                 >

  </editors:SfComboBox>


Style(if this would help)

 <Style x:Key="ComboBoxStyle" TargetType="editors:SfComboBox">

     <Setter Property="DropDownItemHeight" Value="30"></Setter>

     <Setter Property="FontSize" Value="12"/>

     <Setter Property="TextColor" Value="Black"/>

     <Setter Property="PlaceholderColor" Value="#c3c3cb"/>

     <Setter Property="Margin" Value="8,3,0,-3"/>

     <Setter Property="HeightRequest" Value="40"/>

     <Setter Property="FontFamily" Value="poppinslight.ttf#poppinslight"/>

     <Setter Property="DropDownItemFontFamily" Value="poppinslight.ttf#poppinslight"/>

     <Setter Property="IsClearButtonVisible" Value="False"/>

     <Setter Property="BackgroundColor" Value="White"></Setter>

     <Setter Property="Stroke" Value="Transparent"></Setter>

     <Setter Property="ShowBorder" Value="True"></Setter>

     <Setter Property="DropDownBackground" Value="White"></Setter>

     <Setter Property="Background" Value="{StaticResource ButtonGradientBrushGray}"></Setter>

 </Style>


c# to bind data:


 List<ListSource> lp = new List<ListSource>();

 cboproduct.ItemsSource = null;

 cboproduct.SelectedIndex = -1;

 cboproduct.DisplayMemberPath = "Key";

 cboproduct.SelectedValuePath = "Value";

 lp = await GetProducts();

 cboproduct.ItemsSource = lp;

cboproduct.SelectedIndex = lp.FindIndex(x => x.Value == dh.ItemCode);


Thanks


Santhosh



KP Kamalesh Periyasamy Syncfusion Team April 4, 2025 02:12 PM UTC

Hi Santhosh, 


Thanks again for the details you’ve shared so far — they’re really helpful. 

To better understand and isolate the issue, we have a few follow-up questions: 

  1. Just to confirm — could you please share the crash report or stack trace from the MAUI build specifically? The one previously shared appears to reference Xamarin.Android namespaces, so We'd like to double-check if the same stack trace occurs in your MAUI environment. 
  • 2. When this issue occurs: 

    • Does the app crash completely (i.e., close unexpectedly)? 
    • Or is it just an exception that appears in the application logs without affecting the user experience? 
  • 3. Have you observed the issue happening during any specific interaction, such as: 

    • Typing quickly in the ComboBox? 
    • Clearing the input field? 
    • Rapidly changing input or dropdown focus? 

Gathering this information will help us narrow down the issue and investigate it more effectively. 

Looking forward to your response. 

 
Regards, 
Kamalesh P 



SK Santhosh Kumar April 23, 2025 11:40 AM UTC

Dear Kamalesh,


The crash does not happen immediately but there is a log written. It did happen in MAUI but now I'm not able to see any recent logs in the last few month. So let's close this one for now. I will raise another query if I happen to observe this again.


Thanks


Santhosh



PR Preethi Rajakandham Syncfusion Team April 24, 2025 06:03 AM UTC

Hi Santhosh Kumar,

Thank you for the update. 

Please let us know if you require any further assistance on this. We will be happy to assist you.

Regards,

Preethi R


Loader.
Up arrow icon