我想保存两个文件,但其中一个不保存(android编程) [英] I am trying to save two files but one of them doesn't save(android programming)

查看:93
本文介绍了我想保存两个文件,但其中一个不保存(android编程)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

但我收到此错误消息:



But I get this error message:

Quote:

java。 lang.RuntimeException:将结果ResultInfo {who = null,request = 0,result = -1,data = null}传递给activity {com.m.finalocr / com.m.finalocr.MainActivity}:java.lang.IllegalArgumentException:在/storage/emulated/0/FinalOcr/tessdata/fas.traineddata找不到数据文件

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.m.finalocr/com.m.finalocr.MainActivity}: java.lang.IllegalArgumentException: Data file not found at /storage/emulated/0/FinalOcr/tessdata/fas.traineddata





我在Android上不专业,认为我的代码没有不保存fas.traineddata文件,但不知道如何修复它?



我尝试过:



但我收到此错误消息:





I am not professional on Android and think my code doesn't save the fas.traineddata file, but don't know how to fix it?

What I have tried:

But I get this error message:

Quote:

java.lang.RuntimeException:将结果ResultInfo {who = null,request = 0,result = -1,data = null}传递给activity {com.m.finalocr / com.m.finalocr .MainActivity}:java.lang.IllegalArgumentException:在/storage/emulated/0/FinalOcr/tessdata/fas.train找不到数据文件eddata

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.m.finalocr/com.m.finalocr.MainActivity}: java.lang.IllegalArgumentException: Data file not found at /storage/emulated/0/FinalOcr/tessdata/fas.traineddata





我在Android上不专业,认为我的代码没有保存fas.traineddata文件,但不知道如何修复它?



I am not professional on Android and think my code doesn't save the fas.traineddata file, but don't know how to fix it?

推荐答案

异常告诉你.traineddata无法找到,尽管如此,根据你的目录,它就在那里。它找不到文件的原因是因为你的数据路径中有/ tessdata /。



你的文件路径中不应该有/ tessdata /。 Tesseract OCR库本身将确保在/ tessdata /文件夹中搜索.traineddata文件。
The exception is telling you that .traineddata cannot be found, eventhough, according to your directory, it is there. The reason why it does not find the file is because you have /tessdata/ in your data path.

You should NOT have /tessdata/ in your file path. The Tesseract OCR library itself will make sure to search for the .traineddata file in the /tessdata/ folder.


这篇关于我想保存两个文件,但其中一个不保存(android编程)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆