Why cannot call no-static function with JNI?

Why cannot call no-static function with JNI?
0.0 0


Java codes
public class UtilityTool extends android.app.NativeActivity{ public static Activity actInstance;//定义单例 public static Object rtnActivity() { return actInstance; } public void nostaticFun() { Log.e("nostaticFun", "no static Function is OK"); } }

C++ codes:
JniMethodInfo minfo; bool isHave = JniHelper::getStaticMethodInfo(minfo, "com/popstardeluxe/utility/UtilityTool", "rtnActivity", "()Ljava/lang/Object;"); jobject jobj; if (isHave) { jobj = minfo.env->CallStaticObjectMethod(minfo.classID, minfo.methodID); } isHave = JniHelper::getMethodInfo(minfo, "com/apptest/utility/UtilityTool", "nostaticFun", "()V"); if (isHave) { minfo.env->CallVoidMethod(jobj, minfo.methodID); //Error here }
minfo.env->CallVoidMethod(jobj, minfo.methodID) always report error. Why?


Is there a way to force threads to include the version number in question?

I’m not sure if this is a question about JNI or something specific to NativeActivity


The issue found in cocos2d-x 3.0 alpha