I followed demo instructions on page http://www.achartengine.org/content/goodies.html
i successfully imported the demo project, but every chart give throws
a NoClassDefFoundError
at runtime, similar to this:
java.lang.NoClassDefFoundError:
org.achartengine.model.XYMultipleSeriesDataset
achartengine-1.0.0.jar is on build path, and it is reported under 'Referenced Libraries'. I guess this is a newbie problem, but I decided to report it since I just imported the demo project 'as is' and tried to run it on my phone.
Do I need other steps, not listed on 'goodies' page?
Remind to change the "lib" directory to "libs" first !
Then CHECK the box of
achartengine-1.0.0.jar
and move it over the Android Dependencies in the "Configure build path" - "Order and Export" tab"!The error (
NoClassDefFoundError
) you are seeing is runtime error. Referenced library solves only compile time error not runtime error. Add those jars to lib folder of your project. Those jars should be available at runtime also.I found a good answer on google groups, tested it and it seems to be working:
The only thing that I have ever came across in this case is the export of the jar ... if that makes sense.
In Eclipse:
click ok then clean your project. (Project -> Clean...)
The answer from 'Shine' worked with the addition of removing import of
android.R
fromPieChartBuilder
and removing two@Overrides
fromPieChartBuilder
andXY_ChartBuilder
before Eclipse would agree to compile.You need simply to add your jar files to the Libraries folder. It should work fine.