TextRecognizer isOperational API始终返回false [英] TextRecognizer isOperational API always returns false

查看:174
本文介绍了TextRecognizer isOperational API始终返回false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要捕获图像的字符,因此我正在使用TextRecognizer.我的代码在下面给出

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();

我在build.gradle中添加了依赖项,如下所示:

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'       
    }

每次启动apk时,都会显示无法设置文本识别器:.即使我已设置所有依赖项,但仍然出现此错误.请帮助为什么TextRecognizer.isOperational()始终为假.

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.

推荐答案

我找到了问题的答案.

我们需要在命令提示符下应用以下命令.然后问题解决了.

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

这篇关于TextRecognizer isOperational API始终返回false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆