Android JNI DETECTED ERROR IN APPLICATION: JNI GetMethodID called with pending exception

前端 未结 5 1760
春和景丽
春和景丽 2020-12-30 12:09

I\'m trying to run a Googles OCR Tesseract with my android project. I have already complied tesseract with android-ndk and am receiving this error after I try and run the an

5条回答
  •  不知归路
    2020-12-30 12:43

    Most likely the JNI mappings were incorrectly defined in your C++ code. JNI has very strict contracts about type mappings with Java. For example, before calling a Java object's method from JNI, we need its signature. So the method:

    long myMethod (int n, String s, int[] arr);

    is seen from JNI with the signature:

    (ILJAVA/LANG/STRING;[I])J

    You can read a very comprehensive overview of these rules here: http://www.rgagnon.com/javadetails/java-0286.html

提交回复
热议问题