SfChart crashing app only on Relase mode

My app is crashing when I try to open a page that contains a SfChart only when running a release build. A debug build with the same data works just fine.

I'm using the latest stable version of Syncfusion libraries (18.1.0.54) and latest stable Xamarin.Forms (4.6.0.800).

Relase mode is configure to link only SDK Assemblies and Code shrinker is disabled. I've tried even with a blank chart as shown on Getting started page but app still crashs, so that plus the fact that it works on Debug mode tells me there is nothing wrong with my data.

Chart is inside a SfTabView, below is a simplyfied XAML snip:

<ContentPage
    ...
    xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
    ...
>
<ContentPage.Content>
        <tabView:SfTabView
            BackgroundColor="{StaticResource CellBackground}"
            DisplayMode="ImageWithText"
            EnableSwiping="False"
            OverflowMode="Scroll"
            TabHeaderBackgroundColor="{StaticResource LightGrey}"
            TabHeaderPosition="Top"
            TabHeight="60"
            VisibleHeaderCount="2">
            <tabView:SfTabItem
                Title="Track"
                FontIconFontFamily="{StaticResource FontAwesomeFamily}"
                FontIconFontSize="25"
                IconFont="{x:Static control:FontAwesomeIcons.Map}"
                SelectionColor="{StaticResource DarkOrange}"
                TitleFontSize="20">
                <tabView:SfTabItem.Content>
                    <view:MapView BindingContext="{Binding BindingContext, Mode=TwoWay, Source={Reference page}}" />
                </tabView:SfTabItem.Content>
            </tabView:SfTabItem>
            <tabView:SfTabItem
                Title="Statistics"
                FontIconFontFamily="{StaticResource FontAwesomeFamily}"
                FontIconFontSize="25"
                IconFont="{x:Static control:FontAwesomeIcons.ChartLine}"
                SelectionColor="{StaticResource DarkOrange}"
                TitleFontSize="20">
                <tabView:SfTabItem.Content>
                    <ScrollView>
                        <Grid Padding="20,0,20,0">
                            ...
                            <chart:SfChart Grid.Row="8" Grid.ColumnSpan="3">
                                <chart:SfChart.PrimaryAxis>
                                    <chart:DateTimeAxis>
                                        <chart:DateTimeAxis.Title>
                                            <chart:ChartAxisTitle Text="Time" />
                                        </chart:DateTimeAxis.Title>
                                    </chart:DateTimeAxis>
                                </chart:SfChart.PrimaryAxis>
                                <chart:SfChart.SecondaryAxis>
                                    <chart:NumericalAxis>
                                        <chart:NumericalAxis.Title>
                                            <chart:ChartAxisTitle Text="Speed (km/hr)" />
                                        </chart:NumericalAxis.Title>
                                    </chart:NumericalAxis>
                                </chart:SfChart.SecondaryAxis>
                                <chart:SfChart.Series>
                                    <chart:LineSeries
                                        ItemsSource="{Binding SpeedChartItems}"
                                        XBindingPath="CreatedDateTimeUtc"
                                        YBindingPath="SpeedKm" />
                                </chart:SfChart.Series>
                            </chart:SfChart>
                        </Grid>
                    </ScrollView>
                </tabView:SfTabItem.Content>
            </tabView:SfTabItem>
        </tabView:SfTabView>
    </ContentPage.Content>
</control:BaseNavigationPage>

And stack trace attched


Attachment: SfChartcrash_e1759b7a.zip

5 Replies

HM Hemalatha Marikumar Syncfusion Team June 1, 2020 06:45 AM UTC

Hi Eric Lira, 
 
Greetings from Syncfusion. 
 
We have checked the reported query and we have suspected that it may cause while having the Xamarin.Android SfChart package reference in Xamarin.Forms project. 
 
Please ensure whether you have included only the Syncfusion.Xamarin.SfChart package in your Xamarin.Forms project as per in below UG 
 
 
If you have a package reference of Syncfuison.Xamarin.SfChart.Android in android project of Xamarin, then please remove it and also clear bin, obj and ensure it again and let us know. 
 
Regards,
Hemalatha M.
 



EL Eric Lira June 1, 2020 07:00 AM UTC

Hi Hemalatha, thanks for the quick reply.

This is not my case, I installed SfChart using NuGet package and looking at the csproj, I can only see Syncfusion.Xamarin.SfChart referenced (PackageReference) in both, Forms and Android projectects. No direct dll was referenced. See images attached



One thing to notice, if I disable Linker all together the release version works, but off course this is not ideal as my app doubles in size. I tried to add SfChart and SfCore dlls under "Skip linking assemblies" but it had no effect. 

Attachment: References_f68b1480.zip


DD Devakumar Dhanapoosanam Syncfusion Team June 2, 2020 09:50 AM UTC

Hi Eric Lira, 
 
Thanks for your update. 
 
We have checked the same that is worked fine at our end with having Syncfusion.Xamarin.SfChart NuGet reference alone with enabling linker options. Can you please ensure the below things to resolve the reported issue? 
 
1)      Clean your solution (Debug & Release) 
2)      Uninstall the application on your device (or emulator) 
3)      Deploy your solution again. 
 
Please refer the below KB for more details, 
 
Regards, 
Devakumar D 



EL Eric Lira June 16, 2020 02:33 AM UTC

Hello, sorry for the delayed reply, I got pulled over to another project I just had the opportunity to test the last recommendation yesterday.

Clean up solution and Nuget cache seems to fix the problem, however I have to do it every single time I want to build a release version, otherwise the app crashes again on the Chart page.

Yes there any permanent solution for this? I can add a script on pre-build events but that is more like a workaround rather than a fix.


DD Devakumar Dhanapoosanam Syncfusion Team June 17, 2020 02:59 AM UTC

Hi Eric Lira, 
 
Thanks for your update and we are glad to know the previous suggested solution works. 
 
Can you please check your sample after updating latest Android support library version, the android version and ensure us still if you are facing the mentioned issue? 
 
Regards, 
Devakumar D 


Loader.
Up arrow icon