1

I need to capture characters of an image so i am using TextRecognizer. My code is given below

TextRecognizer textRecognizer = new TextRecognizer.Builder(mActivity.getGalleryApplication().getAndroidContext()).build();
if (!textRecognizer.isOperational()) {
    new AlertDialog.Builder(mActivity.getAndroidContext())
                                        .setMessage("Text recognizer could not be set up :(").show();
    return;
}
textRecognizer.release();

I have added dependencies in build.gradle as below:

    dependencies {
        compile 'com.google.android.gms:play-services-maps:10.2.1'
        compile 'com.google.firebase:firebase-appindexing:10.2.1'
        compile 'com.android.support:appcompat-v7:23.0.0'       
    }

Everytime I launch the apk, "Text recognizer could not be set up : is displayed. Even though I have set all dependencies but still i am getting this error. Please help why TextRecognizer.isOperational() is always false.

I have a project to be completed by next weekend. Please help to solve this error.

shilpa
  • 11
  • 2
  • 1
    It downloads other dependencies at runtime. Is your network permission enabled? If so, can you provide your logcat? Should say something like I/Vision when it requests other dependencies. – Stephen Apr 13 '17 at 05:09
  • Hello, Network is enabled, and i am connected to wifi. Does it download dependecies after apk is insatalled? – shilpa Apr 13 '17 at 08:07
  • 04-13 13:38:06.767 7738 7738 I Vision : Loading libocr library 04-13 13:38:06.769 7738 7738 I Vision : libocr load status: false – shilpa Apr 13 '17 at 08:16
  • Can you please let me know why load status is false – shilpa Apr 13 '17 at 08:16

1 Answers1

0

I found answer to my question.

We need to apply the below commands in command prompt. Then issue is resolved.

adb root
adb remount
adb shell setenforce 0  it will disable SE policy 
adb remount
Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
shilpa
  • 11
  • 2