Path.isConvex is not supported. Android Studio - Toggle Button

11,311

Solution 1

Path.isConvex can be removed by using only a single tag for radius than for each corner... so instead of using

<corners 
    android:bottomLeftRadius="10dp"
    android:bottomRightRadius="10dp"
    android:topLeftRadius="10dp"
    android:topRightRadius="10dp"/>

put this

<corners android:radius="10dp"/>

Also, Selective round corners can be achieved using the following code

<corners android:radius="10dp" android:bottomLeftRadius="0dp" android:topRightRadius="0dp"/>

Edit (easy way)

In order to fix it, you can also set it as src instead of background as android:src="@drawable/your_drawable_name"

No problem, It works fine. Tested by me just now.

Solution 2

You are getting this error because some rounded and other square corners do not render at all. You need to provide radius for the toggle button.

Source: https://code.google.com/p/android/issues/detail?id=72999

Solution 3

this implementation has a render problem . or its not fixed . the version before works fine

implementation 'com.google.android.material:material:1.2.0-alpha03'

-->

implementation 'com.google.android.material:material:1.2.0-alpha02'

Share:
11,311
Janine Kroser
Author by

Janine Kroser

Updated on July 18, 2022

Comments

  • Janine Kroser
    Janine Kroser almost 2 years

    I already read about this issue on stackoverflow but unfortunately haven't found the correct answer.

    I use a ToggleButton and it shows me the following error in the rendering window:

    The graphics preview in the layout editor may not be accurate: 
    - Different corner sizes are not supported in Path.addRoundRect. (Ignore for this session) 
    - Path.isConvex is not supported. (Ignore for this session)
    

    The terminal shows the following error message:

    E/dalvikvm: Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.<init>
    

    When I set the api level in the rendering window to 19 instead of 23 the "Rendering problem" window won't appear but the error still occurs in the app when running on a device with Android 4.4.2.

    This is my simple ToggleButton:

    <ToggleButton
                    android:id="@+id/editToggleKunde6"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textOn="@string/kunde_bearbeiten_txt1"
                    android:textOff="@string/kunde_bearbeiten_txt2"
                    android:checked="true"
                    />
    

    Thanks for any idea!

  • AlexVPerl
    AlexVPerl over 6 years
    I'm using radius property only and still receiving the warning. Any combination of using selective round corners gives the warning. Only if you use radius w/o selective round corners gets rid of the warning.
  • Lalit Fauzdar
    Lalit Fauzdar over 6 years
    @AlexVPerl Quick workaround is that you should use the drawable resource as src instead of background which means 'android:src="@drawable/your_drawable_name"`.