noClip() crashes my Android app

When the exported app is started on a Galaxy S8+ (Android 10) via “Run on Device”, the noClip() command crashes the program. When I start the app in an emulator, it works fine (Android 9). My app renders plots in a rectangle and uses clip and noClip() to restict line() output to that rectangle:

clip(Plot_X, Plot_Y, Plot_W, Plot_H);


I get this crash report:

FATAL EXCEPTION: Animation Thread
Process: com.fabsoft.statusmonitor, PID: 22542
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at processing.a2d.PGraphicsAndroid2D.noClip(
at processing.core.PApplet.noClip(
at com.fabsoft.statusmonitor.statusmonitor.RenderPlots(
at com.fabsoft.statusmonitor.statusmonitor.draw(
at processing.core.PApplet.handleDraw(
at processing.core.PSurfaceNone.callDraw(
at processing.core.PSurfaceNone$

Is there a solution, such as calling a Java command with the correct argument instead of Processing’s noClip()?

  • I still use Processing 3.4 because Processing 4 seems buggy (resizing my apps under Windows often hangs the apps).

  • I have installed the Android mode and the Android SDK manually. Installing everything (latest Android mode and Android sdk) through Processing 3 leads to a non-funcional setup - builds fail with “some licences have not been accepted”. I have installed SDK for Android 9.0 API level 28 via Android Studio and I use Android mode 4.1.1.