title: OpenGL ES 2.0 texImage2D() giving error 1280
body: <p>I have an Android APP that works on most phones. However on a few phones part way through loading the textures the call to GLUtils.texImage2D() results in error 1280 GL_INVALID_ENUM. There are 8 textures with the following sizes (512x512, 512x512, 512x512, 512x512, 512x512, 512x512, 256x256, 512x1024) all from .png files with an alpha channel. The code loading the textures is shown below. I have managed to catch the exception happening using ARCA "java.lang.RuntimeException: texImage2D 3: glError 1280", so in this instance it was when it was trying to load the 4th texture, when i==3. There is nothing different about the 4th texture compared to the first 3. The only thing that springs to mind is that the memory to load the textures might be too small, but the error number 1280 GL_INVALID_ENUM doesn't seem to fit. Anyone any ideas?</p>
  
  <pre><code>private void setupTextures(String[] texFiles) {
      // create new texture ids if object has them
      // number of textures
      mTextureIDs = new int[texFiles.length];
  
      GLES20.glGenTextures(texFiles.length, mTextureIDs, 0);
      checkGlError( "glGenTextures" );
  
      for(int i = 0; i &lt; texFiles.length; i++) {
          GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIDs[i]);
          checkGlError( "glBindTexture " + String.valueOf(i) );
  
          // parameters
          GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
          checkGlError( "GL_TEXTURE_MIN_FILTER " + String.valueOf(i) );
  
          GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
          checkGlError( "GL_TEXTURE_MAG_FILTER " + String.valueOf(i) );
  
          GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
          checkGlError( "GL_TEXTURE_WRAP_S " + String.valueOf(i) );
  
          GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);
          checkGlError( "GL_TEXTURE_WRAP_T " + String.valueOf(i) );
  
          int ID = mContext.getResources().getIdentifier( texFiles[i], "raw", "com.antonymsoft.slidixcube" );
          InputStream is = mContext.getResources().openRawResource(ID);
          Bitmap bitmap;
          try {
              bitmap = BitmapFactory.decodeStream(is);
          } finally {
              try {
                  is.close();
              } catch(IOException e) {
                  // Ignore.
              }
          }
  
          // create it 
          GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0);
          checkGlError( "texImage2D " + String.valueOf(i) );
  
          bitmap.recycle();
  
      }
  }
  </code></pre>