0

I'm trying to implement the tess-two api for my Android application and I'm getting this error no matter how I try to fix it:

E/Tesseract(native): Could not initialize Tesseract API with language=eng!

I do have WRITE_EXTERNAL_STORAGE permission in the Manifest.

Also in TessBaseAPI.java file in the tess-two library, all the native functions shows

Cannot resolve corresponding JNI function Java_com_googlecode_tesseract_android_TessBaseAPI_nativeClass

How should I go about fixing this?

June
  • 55
  • 2
  • 9
  • @rmtheis I saved the trained data in my assets folder. so in /assets/tesseract/tessdata. I cloned the whole tessdata from github so I'm using whatever the current version is. As for calling init, i first copy everything from my assets folder to the sdcard, then call init with datapath /sdcard/tesseract. – June Feb 29 '16 at 21:26
  • @rmtheis since that message is not related to initialization failure, how should i fix it? – June Feb 29 '16 at 21:27
  • I copied the .traineddata file to tessdata/ inside the cache folder and then initialized it pointing to the cache dir. It works for me. – ssimm Mar 08 '16 at 17:41

1 Answers1

3

If you're targeting Android API level 23 (Android 6.0), you need to get user permission to access external storage.

rmtheis
  • 5,992
  • 12
  • 61
  • 78