ShinobiChart(Android): ClassNotFoundException


#1

Hello everyone!

I’m getting the following exception when trying to load a SupportChartFragment:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.shinobicontrols.charts.SupportChartFragment" on path: DexPathList[[zip file "/data/app/com.mycompany.myapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.com.mycompany.myapp-2/lib/arm, /vendor/lib, /system/lib]]

Here is my Code:

newFragment = new SupportChartFragment();
ShinobiChart shinobiChart = ((SupportChartFragment) newFragment).getShinobiChart();
shinobiChart.setTitle("Shinobi Chart");
shinobiChart.setLicenseKey(MyApp.getShinobiLicense());

NumberAxis xAxis = new NumberAxis();
shinobiChart.setXAxis(xAxis);

NumberAxis yAxis = new NumberAxis();
shinobiChart.setYAxis(yAxis);

SimpleDataAdapter<Double, Double> dataAdapter1 = new SimpleDataAdapter<Double, Double>();
SimpleDataAdapter<Double, Double> dataAdapter2 = new SimpleDataAdapter<Double, Double>();

for (int i = 0; i < 100; i++) {
    double radians = i * Math.PI / 25.0;
    dataAdapter1.add(new DataPoint<Double, Double>(radians, Math.sin(radians)));
    dataAdapter2.add(new DataPoint<Double, Double>(radians, Math.cos(radians)));
}

LineSeries series1 = new LineSeries();
series1.setDataAdapter(dataAdapter1);
shinobiChart.addSeries(series1);

LineSeries series2 = new LineSeries();
series2.setDataAdapter(dataAdapter2);
shinobiChart.addSeries(series2);

fragmentManager.beginTransaction()
	.replace(R.id.container, newFragment, tag)
	.commit();

I’m using Android Studio 1.2 and shinobicharts-android-trial-1.7.2. I imported ShinobiCharts as module and got all the gradle files up and running.

Hopefully someone can help me out.

Kind regards,

Sandro


#2

No idea why this might happen? I’d really like to use ShinobiCharts in my app, but if it’s not working…


#3

Hello Stsandro

Thanks for getting in touch.

May I please ask, have you seen this blog? :

Could you please review the section entitled: ‘Import ShinobiCharts Library Quick Reference’ and check that you have covered these steps when you imported the library to your application?

Please let us know how you get on.

Thanks,

Kai.