我正在尝试使用 android ML Kit 文本识别库进行文本识别,但在运行时出现错误并且没有返回文本。错误:
W/TextNativeHandle: Native handle not yet available. Reverting to no-op handle.
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.ocr:0 and remote module com.google.android.gms.vision.dynamite.ocr:0
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.ocr:0 and remote module com.google.android.gms.vision.ocr:0
E/Vision: Error loading optional module com.google.android.gms.vision.ocr: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
我已将 build.gradle 中的库导入为:
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.1'
我还在 android 清单文件中添加了以下代码:
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="ocr" />
那我该如何使用 ML Kit 文本识别呢?