Help with Sketch on Processing Android

I´ve made a drawing program on Processing Windows and it works just fine there. The sketch uses a lot of images. But now that I´m finished I wanted to make the sketch into an app. When I try to load the sketch on android however, it won`t even start. All I ever get is this error message:

java.lang.NullPointerException: Attempt to read from field ‘int processing.core.PImage.width’ on a null object reference
at processing.core.PGraphics.background(PGraphics.java:5011)
at processing.core.PApplet.background(PApplet.java:9695)
at processing.test.testdrawing.TestDrawing.draw(TestDrawing.java:73)
at processing.core.PApplet.handleDraw(PApplet.java:1818)
at processing.core.PSurfaceNone.callDraw(PSurfaceNone.java:471)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:503)

Any help is appreciated

Is the issue with your sketch or with getting an Android app to run? That is, can you run any of the sample Android apps?

@Marci1432 ===

  • difficult to help without seeing code
  • difficult to understand what you have done - Writing an app with windows && java mode and trying to make it running with android or what?
  • the error seems to be with some var (array or int or) not instanciated
1 Like