react-native-mlkit-ocr
react-native-mlkit-ocr copied to clipboard
MlkitOcr.detectFromUri is null
HI there,
We try to use running expo sdk 45 and rn 0.69
import MlkitOcr, { MlkitOcrResult } from 'react-native-mlkit-ocr';
const sample_image = "data:image/jpeg;base64,/9j/4QF ............." const text = await MlkitOcr.detectFromUri(sample_image);
we catch the error is MlkitOcr.detectFromUri is null
It seems MlkitOcr is not well defined in the package react-native-mlkit-ocr
Kindly point out the mistakes we have made, many thanks
Albert
bump, same issue
i call it like:
let response = await ImagePicker.launchImageLibraryAsync(
{
mediaType: 'photo',
});
await MlkitOcr.detectFromUri(response.uri);
and error is:
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'MlkitOcr.detectFromUri')]
at node_modules/react-native-mlkit-ocr/src/index.tsx:68:30 in <global>
at node_modules/react-native-mlkit-ocr/src/index.tsx:69:15 in <global>
and response is like (so it does catches something):
Object {
"assetId": null,
"base64": null,
"cancelled": false,
"exif": null,
"height": 1920,
"type": "image",
"uri": "file:///data/user/0/host.exp.exponent/cache/ImagePicker/79f43782-0251-4131-802a-994d714d1a81.png",
"width": 1080,
}