Hello,
I try to develop an application for Android and Windows (UWP) with Xamarin and Syncfusion.
Today I have just write a test application with SfChart. In the XAML file I have add an empty chart.
On Windows the application start without any problem.
On my Mobile Android phone (Android 9.0) the Application Crach with :
Unhandled Exception:
System.InvalidCastException: <Timeout exceeded getting exception details>
This exception is created on LoadApplication(new App()); without any extra detail to helpme.
Below see the MainActivity.cs Code :
namespace App1.Droid
{
[Activity(Label = "App1", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(".................."); //(Off course I have add my key :-)
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
new SfChartRenderer();
LoadApplication(new App());
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}
And the XAML code :
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
mc:Ignorable="d"
x:Class="App1.MainPage">
<chart:SfChart Margin="0,200,0,200">
<chart:SfChart.Title>
<chart:ChartTitle Text="Votre Jounrée"/>
</chart:SfChart.Title>
<chart:SfChart.PrimaryAxis>
<chart:NumericalAxis Minimum="0" Maximum="24" Interval="2">
</chart:NumericalAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis Minimum="0" Maximum="250" Interval="10">
<chart:NumericalAxis.StripLines>
<chart:NumericalStripLine Start="80" Width="50" FillColor="#7FD3D3D3"/>
</chart:NumericalAxis.StripLines>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
</chart:SfChart>
</ContentPage>
Thanks for your help.
Christian