Android Exception when using 3D option in chart

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Android Exception when using 3D option in chart

Post by froggyware » Sun Feb 17, 2013 10:41 pm

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?

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Android Exception when using 3D option in chart

Post by froggyware » Sun Feb 17, 2013 10:52 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Android Exception when using 3D option in chart

Post by Yeray » Mon Feb 18, 2013 9:41 am

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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Android Exception when using 3D option in chart

Post by froggyware » Mon Feb 18, 2013 9:03 pm

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.

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Android Exception when using 3D option in chart

Post by froggyware » Mon Feb 18, 2013 9:05 pm



Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Android Exception when using 3D option in chart

Post by Yeray » Tue Feb 19, 2013 10:47 am

Hello,

Thanks for sharing your progress.
Does the workaround presented at StackOverflow work fine for you?
http://stackoverflow.com/a/10174204
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Android Exception when using 3D option in chart

Post by froggyware » Wed Feb 20, 2013 5:21 pm

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.

Post Reply