I tried to rebuild an android app wich contains tess-two as library. When using as is, I get this error
java.lang.NoSuchFieldError: no field with name='mNativeData' signature='I' in class Lcom/googlecode/tesseract/android/TessBaseAPI;
When reverting commit bc931c966f5a05745bd4be5833f551643589982d (private long mNativeData; changed to private int mNativeData;)
It then works. It might be related to my CPU/ABI.
I'm really not an android nor ndk expert, but this sounds as a bug to me. Should the cpp code not return a long, or the TessBaseAPI.java be adapted to recieve either a int or a long.
Thanks
In the commit you're referring to, that field was changed to be a "long" in both the Java and JNI code in order to support 64-bit devices.
It should be left as a "long" across the board.
If you're using a project that uses a precompiled version of tess.so
, you can roll back the tess-two code to an older version that predates the commit that causes the conflict, for example:
git checkout 69b73ef5952c91b4d5d238f76a027a295f58575d
Alternately, you could build new versions of the *.so files using the tess-two build instructions and replace those files in your project.