Hi !
I am trying to understand how JNI works to call native code (C++) from Java.
There is something really strange I don’t understand… Here it is:
In the Cocos2dxRenderer.java class, there is the following method:
public void handleOnResume(){
nativeOnResume();
}
Consequently, the nativeOnResume() method (which is in Cocos2dJni.cpp class) is called.
If I change the name of this method from:
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume()
to:
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume2() // Note the "2" at the end of the method name
I would expect that a java.lang.UnsatisfiedLinkError error appears…but everything works like if “nativeOnResume()” calls “void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume2()” without any issues…
I performed a clean of my project but still get this issue… Anybody can tell me what is happening?
Note that if I also change “nativeOnResume()” to “nativeOnResume2()” in handleOnResume() method in order to call void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume2(), I get a java.lang.UnsatisfiedLinkError telling me that nativeOnResume2() cannot be found…
Sorry if my question is stupid but I really can’t figure out what I am doing wrong.
Thanks