简体   繁体   English

tess-2接收int但等待很长时间

[英]tess-two reciving int but waiting for long

I tried to rebuild an android app wich contains tess-two as library. 我试图重建一个包含tess-two作为库的android应用。 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; java.lang.NoSuchFieldError:类Lcom / googlecode / tesseract / android / TessBaseAPI中没有名称为'mNativeData'signature ='I'的字段;

When reverting commit bc931c966f5a05745bd4be5833f551643589982d (private long mNativeData; changed to private int mNativeData;) 还原落实时bc931c966f5a05745bd4be5833f551643589982d(专用长mNativeData;已更改为专用int mNativeData;)

It then works. 然后就可以了。 It might be related to my CPU/ABI. 它可能与我的CPU / ABI有关。

I'm really not an android nor ndk expert, but this sounds as a bug to me. 我确实不是Android或ndk专家,但这听起来像是我的错误。 Should the cpp code not return a long, or the TessBaseAPI.java be adapted to recieve either a int or a long. 如果cpp代码不返回long,或者TessBaseAPI.java适合接收int或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. 在您所引用的提交中,为了支持64位设备,该字段在Java和JNI代码中均更改为“ long”。

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: 如果您正在使用使用tess.so的预编译版本的tess.so ,则可以将tess.so两个代码回滚到早于导致冲突的提交的旧版本,例如:

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. 或者,您可以使用tess-两条构建说明来构建* .so文件的新版本,并在项目中替换这些文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM