java.lang.UnsupportedOperationException

Appcelerator JIRA | Bill Dawson | 5 years ago
  1. 0

    Honeycomb introduced hardware acceleration which can be turned on with a setting in the <application> node of AndroidManifest.xml. When it's turned on, and a view has a borderRadius set (> 0), the app crashes because we use clipPath, which is not supported with hw accel. (cf http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html). Re-creation steps: * Create an app. * Make the tiapp.xml's <android> section so: {code:title=tiapp.xml} <android xmlns:android="http://schemas.android.com/apk/res/android"> <tool-api-level>11</tool-api-level> <manifest> <application android:hardwareAccelerated="true"/> </manifest> </android> {code} * Make the app.js so: {code:title=app.js} Titanium.UI.setBackgroundColor('#000'); var win = Titanium.UI.createWindow({ title:'Test', backgroundColor:'#000', exitOnClose: true }); win.add(Ti.UI.createView({ backgroundColor: "blue", borderColor: "red", borderWidth: 10, borderRadius: 5, left: "10dp", right: "10dp", top: "50dp", height: "200dp" })); win.open(); {code} * Run the app on the honeycomb device and it will crash. (When testing the fix, it should not crash of course.). Typical crash logcat entry looks like: {code} E/AndroidRuntime(26499): java.lang.UnsupportedOperationException E/AndroidRuntime(26499): at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287) E/AndroidRuntime(26499): at org.appcelerator.titanium.view.TiBackgroundDrawable.draw(TiBackgroundDrawable.java:73) E/AndroidRuntime(26499): at android.view.View.draw(View.java:9264) ... (etc) {code}

    Appcelerator JIRA | 5 years ago | Bill Dawson
    java.lang.UnsupportedOperationException
  2. 0

    Honeycomb introduced hardware acceleration which can be turned on with a setting in the <application> node of AndroidManifest.xml. When it's turned on, and a view has a borderRadius set (> 0), the app crashes because we use clipPath, which is not supported with hw accel. (cf http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html). Re-creation steps: * Create an app. * Make the tiapp.xml's <android> section so: {code:title=tiapp.xml} <android xmlns:android="http://schemas.android.com/apk/res/android"> <tool-api-level>11</tool-api-level> <manifest> <application android:hardwareAccelerated="true"/> </manifest> </android> {code} * Make the app.js so: {code:title=app.js} Titanium.UI.setBackgroundColor('#000'); var win = Titanium.UI.createWindow({ title:'Test', backgroundColor:'#000', exitOnClose: true }); win.add(Ti.UI.createView({ backgroundColor: "blue", borderColor: "red", borderWidth: 10, borderRadius: 5, left: "10dp", right: "10dp", top: "50dp", height: "200dp" })); win.open(); {code} * Run the app on the honeycomb device and it will crash. (When testing the fix, it should not crash of course.). Typical crash logcat entry looks like: {code} E/AndroidRuntime(26499): java.lang.UnsupportedOperationException E/AndroidRuntime(26499): at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287) E/AndroidRuntime(26499): at org.appcelerator.titanium.view.TiBackgroundDrawable.draw(TiBackgroundDrawable.java:73) E/AndroidRuntime(26499): at android.view.View.draw(View.java:9264) ... (etc) {code}

    Appcelerator JIRA | 5 years ago | Bill Dawson
    java.lang.UnsupportedOperationException
  3. 0

    h4. Problem Description The customer is getting this crash report from Google Play h4. Crash Report {code} java.lang.UnsupportedOperationException at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:387) at org.appcelerator.titanium.view.TiBackgroundDrawable.draw(TiBackgroundDrawable.java:73) at android.view.View.draw(View.java:10865) at android.view.View.getDisplayList(View.java:10319) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.getDisplayList(View.java:10317) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.draw(View.java:10985) at android.widget.FrameLayout.draw(FrameLayout.java:450) at android.widget.ScrollView.draw(ScrollView.java:1524) at android.view.View.getDisplayList(View.java:10319) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.draw(View.java:10883) at android.view.View.getDisplayList(View.java:10319) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.getDisplayList(View.java:10317) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.getDisplayList(View.java:10317) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.getDisplayList(View.java:10317) at android.view.ViewGroup.drawChild(ViewGroup.java:2862) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2495) at android.view.View.draw(View.java:10883) at android.widget.FrameLayout.draw(FrameLayout.java:450) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2106) at android.view.View.getDisplayList(View.java:10319) at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:791) at android.view.ViewRootImpl.draw(ViewRootImpl.java:1889) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1613) at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2418) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4340) 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}

    Appcelerator JIRA | 5 years ago | Mauro Parra-Miranda
    java.lang.UnsupportedOperationException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Use hardwareAcceleration flag with Canvas.clipPath

    Stack Overflow | 5 years ago | Marcos Vasconcelos
    java.lang.UnsupportedOperationException
  6. 0

    UnsupportedOperationException in custom view

    Stack Overflow | 4 years ago | schlingel
    java.lang.UnsupportedOperationException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      No message provided

      at android.view.GLES20Canvas.clipPath()
    2. Android Platform
      GLES20Canvas.clipPath
      1. android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287)
      1 frame
    3. org.appcelerator.titanium
      TiBackgroundDrawable.draw
      1. org.appcelerator.titanium.view.TiBackgroundDrawable.draw(TiBackgroundDrawable.java:73)
      1 frame
    4. Android Platform
      View.draw
      1. android.view.View.draw(View.java:9264)
      1 frame