Reputation: 16774
I'm Trying to call this JAVA
function:
public String getPreferredLanguage(boolean withRegion)
With JNI
GetMethodID
, But i always get a crash, i tried a lot of variations about the function signature in the JNI
section, but none seemed to be helping.
The JNI
code:
methodID getPreferredLanguageMethod = env->GetMethodID(languageServiceClass, "getPreferredLanguage", "(Ljava/lang/Boolean;Z)Ljava/lang/String;");
if (!getPreferredLanguageMethod) {
TTLOGD("LanguageService::getPreferredLanguage: ERROR getPreferredLanguageMethod is null\n");
}
The crash message:
JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.NoSuchMethodError: no non-static method "Lcom/tabtale/mobile/acs/services/LanguageService;.getPreferredLanguage(Ljava/lang/Boolean;Z)Ljava/lang/String;"
Any idea what i'm doing wrong?
Upvotes: 1
Views: 2277