alamkanak / Android-Week-View

Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Apache License 2.0
3.42k stars 1.23k forks source link

java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed #541

Open gadaramaulik opened 5 years ago

gadaramaulik commented 5 years ago
nikhilwork commented 5 years ago

I am also facing the same issue.

ghost commented 5 years ago

https://stackoverflow.com/questions/50231950/what-is-the-best-alternative-to-canvas-cliprect-with-region-op-replace

mayuce commented 5 years ago

change targetSdkVersion 28 to 27 from app level build.gradle

ghost commented 5 years ago

https://github.com/AndroidDeveloperLB/Android-Week-View/ fork of this library, but maintained.

Nikoloutsos commented 5 years ago

change targetSdkVersion 28 to 27 from app level build.gradle

This helped me solve my problem but it is not a viable solution anymore because google wants all the apps to have a targetSDK >= 28 until August.

Nikoloutsos commented 5 years ago

After reading some StackOverflow posts I found the solution to this problem without changing target SDK.

The problematic line is canvas.clipRect() when used with Region.Op.Replaced

To fix the error you have to:

TL;DR Source code