We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Error inflating class SfChart - Didn't find class

Thread ID:

Created:

Updated:

Platform:

Replies:

119914 Aug 13,2015 03:28 AM Aug 17,2015 01:13 AM Xamarin.Android 3
loading
Tags: SfChart
Cathryn McDonald
Asked On August 13, 2015 03:28 AM

I'm trying to create a chart in Xamarin.Android using XAML. I created the namespace in the XAML file as shown:

<RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"
       xmlns:syncfusion="clr-namespace:Syncfusion.SfChart.Android;assembly:Syncfusion.SfChart.Android"
    p1:orientation="vertical"
    p1:layout_width="match_parent" etc. etc.

and later in the XAML layout I created the chart as follows:

    <syncfusion:SfChart
        p1:id="@+id/applianceGraph"
        p1:layout_width="match_parent"
        p1:layout_height="match_parent"
        p1:layout_weight="1"
        p1:layout_below="@id/priorityBar"
        p1:layout_above="@id/APNavigationButtons" >
    </syncfusion:SfChart>

But I end up getting the following error at runtime:

Unable to start activity ComponentInfo{com.companyname.wattsapp_android/md5efa703fe96fd0fe248cc39ed8e34e902.AppliancePageActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class SfChart

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.SfChart" on path: DexPathList[[zip file "/data/app/com.companyname.wattsapp_android-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.companyname.wattsapp_android-2, /vendor/lib, /system/lib]]


How do you get the program to look in the Syncfusion library? I've added the assembly reference Syncfusion.SfChart.Android.dll as described in the Getting Started page. Is there an additional step I've missed?

Yuvaraj Palanisamy [Syncfusion]
Replied On August 14, 2015 03:15 AM

Hi Cathryn,


Thanks for using Syncfusion products,


We request you to use the below code example to initialize the chart in xml layout.

 [XML]


<com.syncfusion.charts.SfChart


        p1:id="@+id/applianceGraph"

        p1:layout_width="match_parent"

        p1:layout_height="match_parent"

        p1:layout_weight="1"

        p1:layout_below="@id/priorityBar"

        p1:layout_above="@id/APNavigationButtons">


</com.syncfusion.charts.SfChart>      




Please let us know if you require further assistance, we are happy to assist you.


Thanks,
Yuvaraj


Cathryn McDonald
Replied On August 16, 2015 03:22 AM

Thanks! </com.syncfusion.charts.SfChart> didn't work, but I tried </com.syncfusion.widget.chart.SfChart> and that worked perfectly

Yuvaraj Palanisamy [Syncfusion]
Replied On August 17, 2015 01:13 AM

Hi Cathryn,

Thanks for the update.

Please let us know if you require further assistance on this.

Thanks,
Yuvaraj

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;