The pixels array is null using setTexture()

Running the simple sketch below on Android I keep getting “The pixels array is null.” error. The error does not happen when I use Java mode on my computer. From what I’ve read this error is usually caused by a missing loadPixels() but I understand I should only be using that when I’m actually working on the pixels array and this isn’t. Adding loadPixels() does not fix the issue in any case. setTexture() seems to be the issue but the texture loads and displays just fine. Is there something I’m missing here - a Android permission, a library I should be loading?

//radius of sphere
float sphereradius = 100;

//the sphere shape
PImage thetexture;
PShape thesphere;

//when the app first runs
void setup()
  //set fullscreen, 3D mode and portrait

  //load an image
  thetexture = loadImage("red-chevron.jpg");

  //disable stroke

  //create a sphere shape and set the image as its texture
  thesphere = createShape(SPHERE, sphereradius);
  thesphere.setTexture(thetexture); //<-- the setTexture() causes the error

//the looping function of the app
void draw()
  //set the background colour as green/blue (refresh the screen)
  background(0, 200, 200);

  //activate lights (shadow on sphere)
  //translate to screen centre - this is used as the sphere's starting point (0, 0)
  translate(width / 2, height / 2, 0);

  //show sphere shape

Could you post the picture?


Nothing wrong with it, it was a downloaded image but pushed it through Gimp just in case.

I’ve just tested it on APDE. Running perfectly!

It’s loading and displaying fine here too but as I said the console shows the error “The pixels array is null.”. I can ignore it but it shouldn’t do this.

I don’t get any error or warning.