title: OPEN GL ES 2.0 - glGetAttribLocation returning -1
body: <p>I have this code:  </p>
  
  <pre><code>@Override
  public void onSurfaceCreated(GL10 gl, EGLConfig config) {
      GLES20.glClearColor(0, 0, 0, 1.0f);
  
      int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER,
              getVertexShader());
      int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER,
              getFragmentShader());
      mProgram = GLES20.glCreateProgram();
      GLES20.glAttachShader(mProgram, vertexShader);
      GLES20.glAttachShader(mProgram, fragmentShader);
      GLES20.glLinkProgram(mProgram);
  
      Matrix.setIdentityM(mMMatrix, 0);
  
      **maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");**
  
  }
  </code></pre>
  
  <p>and after the marked line, maPositionHandle is -1 for some reason.</p>
  
  <p>Here's my vert shader:</p>
  
  <pre><code>uniform mat4 uTMatrix;
  uniform mat4 uMVPMatrix;
  attribute vec4 aPosition;
  attribute vec2 aTextureCoord;
  varying vec2 vTextureCoord;
  
  void main() {
      gl_Position = uMVPMatrix * uTMatrix * gl_Position;
      vTextureCoord = aTextureCoord;
  }
  </code></pre>
  
  <p>as you can see, there is an attribute named aPosition, yet i get -1 and I get no drawing output on screen.
  How do I fix this? thanks.</p>