2017-09-30 89 views
0

獲取主要活動頁面上這個錯誤... System.TypeLoadException:(空)syncfusion Xamarin錯誤

只是想實現:在解碼自定義屬性未能加載類型Syncfusion.RangeNavigator.XForms.Droid.RangeNavigatorEventDependencyService一個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> 

回答

0

看起來你正在使用圖表控件xamarin形式的版本。請確保您在Android項目

Syncfusion.SfChart.XForms.Android.dll

Syncfusion.SfChart.XForms.dll

https://help.syncfusion.com/xamarin/introduction/control-dependencies#sfchart

+0

我已經做到了。不知道如果我做了正確的,但是。我在Mac上的視覺工作室社區。我右鍵點擊引用和編輯引用然後網絡程序集,並瀏覽所需的文件,並點擊確定 –

+0

你使用項目中的任何其他syncfusion控件? –

+0

我試圖使用數據網格控件,但無法讓它工作,所以只是做了我自己的自定義列表視圖。 –

0

我們懇請引用添加到以下的dll你要重建並運行你的應用程序來解決這個問題。