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?

3
  • @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. Commented Feb 29, 2016 at 21:26
  • @rmtheis since that message is not related to initialization failure, how should i fix it? Commented Feb 29, 2016 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. Commented Mar 8, 2016 at 17:41

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.