# noClip() crashes my Android app

**URL:** <https://discourse.processing.org/t/noclip-crashes-my-android-app/42543>\
**Category:** Processing for Android\
**Created:** [August 3, 2023, 1:39pm UTC](https://discourse.processing.org/t/noclip-crashes-my-android-app/42543 "2023-08-03T13:39:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtmr](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dtmr](https://discourse.processing.org/u/dtmr)\
**Post date:** [August 3, 2023, 1:39pm UTC](https://discourse.processing.org/t/noclip-crashes-my-android-app/42543/1 "2023-08-03T13:39:10Z")

</div>

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);  
…  
noClip();

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 android.graphics.Canvas.checkValidClipOp(Canvas.java:779)  
at android.graphics.Canvas.clipRect(Canvas.java:918)  
at processing.a2d.PGraphicsAndroid2D.noClip(PGraphicsAndroid2D.java:535)  
at processing.core.PApplet.noClip(PApplet.java:8632)  
at com.fabsoft.statusmonitor.statusmonitor.RenderPlots(statusmonitor.java:4397)  
at com.fabsoft.statusmonitor.statusmonitor.draw(statusmonitor.java:1926)  
at processing.core.PApplet.handleDraw(PApplet.java:1852)  
at processing.core.PSurfaceNone.callDraw(PSurfaceNone.java:476)  
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:516)

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.
