0

I have switched from back camera to front camera, React native camera but it will crash without any log. Here is the following code.

 <RNCamera
                          ref={ref}
                            autoFocus={RNCamera.Constants.AutoFocus.on}
                         
                            type={RNCamera.Constants.Type.front}
                            androidCameraPermissionOptions={{
                                title: 'Permission to use camera',
                                message: 'We need your permission to use your camera',
                                buttonPositive: 'Ok',
                                buttonNegative: 'Cancel',
                            }}

                            onTextRecognized={({textBlocks})=>{console.log(textBlocks)}}
Chanrithisak Phok
  • 1,590
  • 1
  • 19
  • 29

2 Answers2

1

Facing same issue. Whenever I open camera and the line

onTextRecognized={({textBlocks})=>{console.log("textBlocks===", textBlocks)}}

craches the app. without showing any error in logs. Whenever I comment this line . App works fine

jawad zahoor
  • 81
  • 1
  • 6
0

Try changing

missingDimensionStrategy 'react-native-camera', 'general' 

to

missingDimensionStrategy 'react-native-camera', 'mlkit'

in build.gradle

lochmaddy
  • 21
  • 4