JoeyEamigh / react-native-text-recognition

MIT License
23 stars 14 forks source link

Android only issue "Waiting for the text optional module to be downloaded" #7

Open SeongwoonHong opened 1 year ago

SeongwoonHong commented 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",

gomesbreno commented 1 year ago

Same problem

JoeyEamigh commented 1 year ago

Have you tried the ml branch? npm install react-native-text-recognition@ml - https://github.com/JoeyEamigh/react-native-text-recognition/tree/ml-only

rrasconc commented 1 year ago

Same problem with android emulator