Open SeongwoonHong opened 1 year ago
import { Camera, useCameraDevices } from 'react-native-vision-camera'; import TextRecognition from 'react-native-text-recognition'; ... const devices = useCameraDevices(); const camera = useRef<Camera>(null); const takePhoto = async () => { try { const photo = await camera.current.takePhoto({ flash: 'on', }) console.log('photo.path = ', photo.path) const result: string[] | number[] = await TextRecognition.recognize(photo.path); console.log('result ', result) } catch (e) { console.log('2') console.log(e) } }; return ( ... <Camera style={StyleSheet.absoluteFill} device={device} ref={camera} isActive={true} photo={true} /> {device && ( <Button onPress={openCamera} /> )} )
I'm getting this error message
waiting for the text optional module to be downloaded
What is printed on the console is
photo.path = blahblah.. waiting for the text optional module to be downloaded
meaning it's react-native-text-recognition causing this error.
But this perfectly works fine on iOS.
"react-native-text-recognition": "^1.0.0",
"react-native-vision-camera": "^2.14.1",
Same problem
Have you tried the ml branch? npm install react-native-text-recognition@ml - https://github.com/JoeyEamigh/react-native-text-recognition/tree/ml-only
ml
npm install react-native-text-recognition@ml
Same problem with android emulator
I'm getting this error message
What is printed on the console is
meaning it's react-native-text-recognition causing this error.
But this perfectly works fine on iOS.
"react-native-vision-camera": "^2.14.1",