在主活动页上获取此错误...System.TypeLoadException:在对自定义属性进行解码时无法加载类型Syncfusion.RangeNavigator.XForms.Droid.RangeNavigatorEventDependencyService:(System.TypeLoadException)
只是试图实现一个sfchart,甚至还没有开始,已经得到了一个错误。
下面是我的主要活动代码
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Syncfusion.SfChart.XForms.Droid;
namespace Drip.Droid
{
[Activity(Label = "Drip.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
new SfChartRenderer();
LoadApplication(new App());
}
}
}下面是我的xaml代码
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Drip.MyPage" xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms">
<ContentPage.Content>
<chart:SfChart x:Name="Chart">
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis LabelRotationAngle= "-45">
<chart:CategoryAxis.Title>
<chart:ChartAxisTitle Text="Meetup Date"/>
</chart:CategoryAxis.Title>
</chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis>
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle Text="Count"/>
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
</chart:SfChart>
</ContentPage.Content>
</ContentPage>发布于 2017-09-30 20:30:13
看起来您使用的是图表控件的xamarin窗体版本。确保在android项目中添加对以下dll的引用
Syncfusion.SfChart.XForms.Android.dll
Syncfusion.SfChart.XForms.dll
https://help.syncfusion.com/xamarin/introduction/control-dependencies#sfchart
发布于 2017-10-04 17:57:44
我们恳请您重新构建并运行您的应用程序来解决此问题。
https://stackoverflow.com/questions/46501993
复制相似问题