Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
But I get this error message:

Quote:
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


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: 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


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?
Posted
Updated 12-Mar-18 20:04pm
v4

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900