When using the Java interface on android, I made two stupid mistakes that cost me a lot of time.
The presence of this id method:
jmethodID myMethod_methodID = env->GetMethodID(hello_Cls, "myMethod", "(ILjava/lang/String;Ljava/lang/String;I)Z");
My first mistake caused it with
env->CallVoidMethod
and my second error caused it like this:
jboolean rv = jenv->CallBooleanMethod(hello_obj, myMethod_methodID, myfirst_jstring, mysecond_jstring, 1);
where there was clearly no jint argument between myMethod_methodID and myfirst_jstring .
It took me a long time to track these errors because there was no relevant output in logcat and the only behavior did nothing (it didn't even crash).
So the question is: How to get more meaningful errors for such errors?
source share