0

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

4

1 回答 1

1

在您所指的提交中,该字段在 Java 和 JNI 代码中都更改为“长”,以支持 64 位设备。

它应该全线保留为“长”。

如果您使用的项目使用 的预编译版本tess.so,则可以将 tess-two 代码回滚到导致冲突的提交之前的旧版本,例如:

git checkout 69b73ef5952c91b4d5d238f76a027a295f58575d

或者,您可以使用 tess-two 构建指令构建 *.so 文件的新版本,并在项目中替换这些文件。

于 2015-05-23T15:11:47.130 回答