Processing in android studio with androidx support

The latest version of android studio use new androidx support library as default.
You could still refactor to AppCompat but it is not recommended and one day it will be completely deprecated.
The android version of processing still use AppCompat, but even you enable legacy support, it still won’t work in androidx environment.
Here’s the solution.

I migrated the latest version “Aug 5, 2019 commit 19c6d03” to androidx.
(ONLY core library)

For your convenience,

Let me know if you find any bug.


I am getting the error below. It seems I cannot yet use P3D mode because the app works when I just use regular java 2d renderer.

java.lang.NullPointerException: Attempt to invoke virtual method ‘’ on a null object reference

at processing.opengl.PGL.loadVertexShader(
at processing.opengl.PGraphics2DX.getShader(
at processing.opengl.PGraphics2DX.flushBuffer(
at processing.opengl.PGraphics2DX.textureImpl(
at processing.opengl.PGraphics2DX.textCharModelImpl(
at processing.opengl.PGraphicsOpenGL.textCharImpl(
at processing.core.PGraphics.textLineImpl(
at processing.opengl.PGraphicsOpenGL.textLineImpl(
at processing.core.PGraphics.textLineAlignImpl(
at processing.opengl.PGraphicsOpenGL.text(
at processing.core.PApplet.text(
at xds.rq2.integrationtest1.Visualizations.SketchMaster.drawWarnings(
at xds.rq2.integrationtest1.Visualizations.SketchMaster.draw(
at processing.core.PApplet.handleDraw(
at processing.opengl.PSurfaceGLES$RendererGLES.onDrawFrame(
at android.opengl.GLSurfaceView$GLThread.guardedRun(
at android.opengl.GLSurfaceView$

It might be I forgot include the shader folder. Open the jar as zip file, and put this folder inside.

If the problem still existed, I will suggest you to try using the official build in android studio, you need to refactor to AppCompat or use older version of android studio.

1 Like

Thanks! I think it works for me now with P3D mode. Doing further testing.
I placed the updated jar file here:

Good to hear! Hahhhhh.

Their have been some updates since the converted commit in August. Would you be able to provide the .java source files so the community can keep up with the latest changes in adapting the library to androidx?

Hi technew,
i really appreciate it very much that you updated the files to the new androidx libraries, because i have been strugling with that for the past 4 days. I would really like to know how you managed to do that, so if you are willing to explain it to me(via discord or in the comments idk which way would be the best)
i would be very very grateful. :grin: :grin: :grin: :grin:

I am very interested in how this is going to work out, migrating to androidx has been a nightmare…

Just tried the download, it totally works! Thanks @technew and @artRenewal

Is there any official Processing support for this going forward? You know how Android loves to depreciate stuff…


You guys are welcome.
I might update androidx version to match the lastest github version in recent time depends on my other workflow.

1 Like