TextRecognizer isOperational API always returns false

匿名 (未验证) 提交于 2019-12-03 01:05:01

问题:

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.

回答1:

I found answer to my question.

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!