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, https://drive.google.com/open?id=1Vcv06UTqrwIZ6K74oXo4dr0cDspYc6D8

Let me know if you find any bug.

2 Likes

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 ‘java.io.InputStream java.net.URL.openStream()’ on a null object reference

at processing.opengl.PGL.loadVertexShader(PGL.java:1896)
at processing.opengl.PGraphics2DX.getShader(PGraphics2DX.java:1742)
at processing.opengl.PGraphics2DX.flushBuffer(PGraphics2DX.java:1676)
at processing.opengl.PGraphics2DX.textureImpl(PGraphics2DX.java:1804)
at processing.opengl.PGraphics2DX.textCharModelImpl(PGraphics2DX.java:1089)
at processing.opengl.PGraphicsOpenGL.textCharImpl(PGraphicsOpenGL.java:3790)
at processing.core.PGraphics.textLineImpl(PGraphics.java:3821)
at processing.opengl.PGraphicsOpenGL.textLineImpl(PGraphicsOpenGL.java:3740)
at processing.core.PGraphics.textLineAlignImpl(PGraphics.java:3811)
at processing.opengl.PGraphicsOpenGL.text(PGraphicsOpenGL.java:3653)
at processing.core.PApplet.text(PApplet.java:9020)
at xds.rq2.integrationtest1.Visualizations.SketchMaster.drawWarnings(SketchMaster.java:832)
at xds.rq2.integrationtest1.Visualizations.SketchMaster.draw(SketchMaster.java:333)
at processing.core.PApplet.handleDraw(PApplet.java:1901)
at processing.opengl.PSurfaceGLES$RendererGLES.onDrawFrame(PSurfaceGLES.java:264)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1535)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

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

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.

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.