This is a migrated thread and some comments may be shown as answers.
Runtime error after adding Chart-references
3 Answers 29 Views
This is a migrated thread and some comments may be shown as answers.
Sami
Top achievements
Rank 1
Sami asked on 13 Dec 2016, 10:31 PM

I just started to implement charting but run into an issue only after adding the required references as guided on page: http://docs.telerik.com/devtools/xamarin/controls/chart/getting-started/chart-getting-started-required-assemblies

When starting my application, OnCreate method in my MainActivity throws the following exception: Java.Lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ContentFrameLayout.setId(int)' on a null object reference

I got DataForm controls up and running, but Chart control throws, even without writing a single line of code, only adding the references break my app. If I remove the references it will start to work again.

Any ideas what may be wrong?

3 Answers, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 15 Dec 2016, 07:40 AM
Hello Sami,

Thank you for contacting us.
The most probable reason for getting this error is incorrect (old) version of the Xamarin.Forms NuGet package used. The default project template for Xamarin project uses quite outdated version of this NuGet (2.2.0.45), while our controls target the latest available version (2.3.3.175). So updating Xamarin.Forms NuGet should fix the problem. Please note that you need to update ONLY Xamarin.Forms and NOT the other (Xamarin.Android.Support.xxx) NuGets.


Also you may need to increase the "Java Max Heap Size" property for the Android project if you receive the "java.lang.OutOfMemoryError" during the build of the project.



Regards,
Vladislav
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sami
Top achievements
Rank 1
answered on 16 Dec 2016, 08:14 AM

Thanks Vladislav,

That indeed fixed the problem. I was following the guidance here: http://docs.telerik.com/devtools/xamarin/installation-and-deployment/required-android-support-libraries . So you may need to update that page?

0
Lance | Manager Technical Support
Telerik team
answered on 16 Dec 2016, 06:02 PM
Hello Sami,

Thank you for letting us know about the outdated documentation page. We will update it as soon as the next documentation push goes out.

In case you encounter this again in the future, here's a trick I use to see exactly what each project requires by using our Visual Studio project creation wizard.

The Wizard will automatically create, in just a few seconds, all the of target platform projects and adds all the required parts (i.e. required dependencies/references, namespace attributes for the renderers on all platforms, instantiates the renderers where needed (iOS) and finally all the individual TelerikForms.Init() calls)

Here's all you have to do to get a working app on all the platforms

1 - In Visual Studio, choose File > New > TelerikXFApp app template (use the filter box to find it quickly)
2- In the wizard, check off all the platforms you want and click OK, this will create all the projects.
3 - Rebuild solution (this will pull in all the missing Nuget packages)

That's it, you can now explore the different project's configuration/dependencies or deploy to emulator/device. 

Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Sami
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Sami
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Share this question
or