Page 1 of 1

Android Exception when using 3D option in chart

Posted: Sun Feb 17, 2013 10:41 pm
by 17060769
Hi,

We are getting the following error message when creating a 3D Chart on Android 4.0.4

We are able to reproduce this on a HTC ONE S running android 4.0.4

02-17 23:33:55.298: ERROR/AndroidRuntime(23245): FATAL EXCEPTION: main
java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:451)
at com.steema.teechart.android.Graphics3DAndroid.clipPolygon(Graphics3DAndroid.java:312)
at com.steema.teechart.drawing.Graphics3D.clipToRight(Graphics3D.java:4575)
at com.steema.teechart.drawing.Graphics3D.clipCube(Graphics3D.java:4614)
at com.steema.teechart.styles.Series.clipRegionCreate(Series.java:2088)
at com.steema.teechart.styles.Series.drawSeries(Series.java:2311)
at com.steema.teechart.Chart.drawAllSeries(Chart.java:790)
at com.steema.teechart.Chart.drawAxesSeries(Chart.java:752)
at com.steema.teechart.Chart.internalDraw(Chart.java:732)
at com.steema.teechart.Chart.paint(Chart.java:2080)
at com.steema.teechart.Chart.paint(Chart.java:2096)
at com.steema.teechart.TChart.onDraw(TChart.java:322)
at android.view.View.draw(View.java:11014)
at android.view.View.getDisplayList(View.java:10444)
at android.view.ViewGroup.drawChild(ViewGroup.java:3167)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793)
at android.view.View.getDisplayList(View.java:10442)
at android.view.ViewGroup.drawChild(ViewGroup.java:3167)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793)
at android.view.View.draw(View.java:11017)
at android.view.View.getDisplayList(View.java:10444)
at android.view.ViewGroup.drawChild(ViewGroup.java:3167)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793)
at android.view.View.getDisplayList(View.java:10442)
at android.view.ViewGroup.drawChild(ViewGroup.java:3167)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793)
at android.view.View.getDisplayList(View.java:10442)
at android.view.ViewGroup.drawChild(ViewGroup.java:3167)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793)
at android.view.View.draw(View.java:11017)
at android.widget.FrameLayout.draw(FrameLayout.java:450)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2214)
at android.view.View.getDisplayList(View.java:10444)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:899)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2123)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1810)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2700)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)


Code:

chart = new TChart(getBaseContext());
Language.activate(Locale.getDefault().getLanguage());
// Add the chart
LinearLayout detailChart = (LinearLayout) findViewById(R.id.linearLayoutTchart_detail);
detailChart.removeAllViews();
detailChart.addView(chart);

chart.getAspect().setPerspective(100);
chart.getAspect().setChart3DPercent(15);
chart.getAspect().setView3D(isDisplay3DChart);

Line dummy = new Line(chart.getChart());
dummy.setColor(Color.BLACK);
dummy.setShowInLegend(false);
dummy.add(0, 0, "");
dummy.add(1, 0, "");
dummy.add(2, 0, "");
dummy.add(3, 0, "");
dummy.add(4, 0, "");
dummy.add(5, 0, "");

Any Ideas?

Re: Android Exception when using 3D option in chart

Posted: Sun Feb 17, 2013 10:52 pm
by 17060769
I just tested on the same hardware with android 4.1.1 and it works.

clearly an android 4.0.4 problem. Nasty,

Not sure how to work around it.

Re: Android Exception when using 3D option in chart

Posted: Mon Feb 18, 2013 9:41 am
by yeray
Hello,

I don't get any error with the v4.0.3 emulator. It may be some important step I could be missing to reproduce the problem. Could you please try to reproduce the problem in a simple example project and in an emulator?

Re: Android Exception when using 3D option in chart

Posted: Mon Feb 18, 2013 9:03 pm
by 17060769
Hi,

I can confirm that everything is working fine in the emulator with 4.0.3.

For the moment I put in place a work around and just disable the 3D option for SDK 15.

Looks like the bug is only reproducible on physical devices. We have many crash reports from different customers, so its not an isolated problem, but more widespread. Looks like really a OS level problem.

S.

Re: Android Exception when using 3D option in chart

Posted: Mon Feb 18, 2013 9:05 pm
by 17060769

Re: Android Exception when using 3D option in chart

Posted: Mon Feb 18, 2013 9:07 pm
by 17060769

Re: Android Exception when using 3D option in chart

Posted: Tue Feb 19, 2013 10:47 am
by yeray
Hello,

Thanks for sharing your progress.
Does the workaround presented at StackOverflow work fine for you?
http://stackoverflow.com/a/10174204

Re: Android Exception when using 3D option in chart

Posted: Wed Feb 20, 2013 5:21 pm
by 17060769
Hi,

I tried the solution and attempted to disable the hardware acceleration, but this had no effect. I still got a FC.
Looks like some device / OS Combinations are the problem. HTC is certainly an issue as we have these in the office.
I spent one day on it now looking for a solution, but was not successful.

It's not a show stopper for us as we just decided to disable 3D charts in this version of Android. Seems effort vs result is not positive. We leave it out :-)

S.