title: JNI NewStringUTF called with pending exception 'java.lang.NoSuchMethodError'
body: <p>I don't know why exception is being thrown when I call native method.</p>
  
  <p>Native code :</p>
  
  <pre><code>JNIEXPORT jstring JNICALL Java_org_amk_lockscreen_JNIActivity_getPackege(JNIEnv *env,jclass cls,jobject context){
      jclass Context_class = (*env).FindClass("android/content/Context");
      jmethodID midGetPackageName = (*env).GetMethodID(Context_class, "getPackageName", "(V)Ljava/lang/String;");
      if(midGetPackageName==0){
          return (*env).NewStringUTF("Not Found Method");
      }
      else{
          jobject packageName=(*env).CallObjectMethod( context, midGetPackageName);
          return (jstring)packageName;
      }
  }
  </code></pre>
  
  <p>and my java code:</p>
  
  <pre><code>public class JNIActivity extends Activity {
  
      static {
          System.loadLibrary("myjni"); // "myjni.dll" in Windows, "libmyjni.so" in Unixes
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_jni);
          TextView txt = (TextView) findViewById(R.id.txtMessage);
          try {
              txt.setText(getPackege(getApplicationContext()));
          } catch (Exception exp) {
              txt.setText(exp.getMessage());
          }
      }
  
      public native String getMessage();
  
      public native String getPackege(Context con);
  }
  </code></pre>
  
  <p>but when run this, it throws exception:</p>
  
  <pre><code>JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception 'java.lang.NoSuchMethodError' thrown in java.lang.String org.amk.lockscreen.JNIActivity.getPackege(android.content.Context):-2
  in call to NewStringUTF
  from java.lang.String org.amk.lockscreen.JNIActivity.getPackege(android.content.Context)
  </code></pre>
  
  <p>I have tested different method signature, like:</p>
  
  <pre><code>(Ljava/lang/Void;)Ljava/lang/String;     
     (V;)Ljava/lang/String;
  </code></pre>
  
  <p>but it throws exception again.</p>
  
  <p>Where I made a mistake?</p>