java.lang.IllegalArgumentException: Invalid Region.Op – only INTERSECT and DIFFERENCE in Button background failure

UPDATE

The fix for this will be included in Android Studio 3.5 Canary 2

enter image description here

java.lang.IllegalArgumentException: Invalid Region.Op – only INTERSECT and DIFFERENCE

The issue with targetSdkVersion 28

Looks like this started being enforced in P: https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.RectF,%20android.graphics.Region.Op)

also reported here

Temporary solution for your case

Use

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

instead of

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

Leave a Comment