title: How to fix JNI crash on env->NewObject()?
body: <p>Here is my program:</p>
  
  <pre><code>extern "C" {        
   JNIEXPORT jint Java_android_app_integrity_VerifyIntegrity_checkCrc(JNIEnv *jniEnv,jobject thiz,jstring crcStr) {
  
      jclass clsZipFile = jniEnv-&gt;FindClass("java/util/zip/ZipFile");
      jmethodID mtdConstruct = jniEnv-&gt;GetMethodID(clsZipFile, "&lt;init&gt;", "(Ljava/lang/String;)V");
      jmethodID mtdGetEntry = jniEnv-&gt;GetMethodID(clsZipFile,"getEntry","(Ljava/lang/String;)Ljava/util/zip/ZipEntry;");
      jclass clsZipEntry = jniEnv-&gt;FindClass("java/util/zip/ZipEntry");
      jmethodID mtdGetCrc = jniEnv-&gt;GetMethodID(clsZipEntry,"getCrc","()L");
      LOGD("pos2");
  
      jobject objZipFile = jniEnv-&gt;NewObject(clsZipFile,mtdConstruct,crcStr);
      if (NULL == objZipFile){
          LOGD("NULL == objZipFile");
      }
  
      LOGD("pos3");
      jobject objZipEntry = jniEnv-&gt;CallObjectMethod(objZipFile, mtdGetEntry,"classes.dex");
      LOGD("pos4");
      jlong ret = jniEnv-&gt;CallLongMethod(objZipEntry, mtdGetCrc);
  
      LOGD("%ld",(long int)ret);
      return 0;
  }
  };
  </code></pre>
  
  <p>It only print "pos2". The line below the "LOGD("pos2");" will cause crash!
  I can't find the reason. Who can help me? Thx! </p>