JNI调用类的方法出现java.lang.NullPointerException错误,求指点
使用c++调用java类的方法,代码如下:
jclass cls = FindClass...;//FindClass成功
jmethodID mid = m_env->GetMethodID(cls,"test","()Ljava/lang/String;");
jobject obj = env->AllocObject(cls);
jstring jstr = (jstring)env->CallObjectMethod(obj,mid);//java.lang.NullPointerException