Expo standalone android app crashes with face detector error

Please provide the following:

  1. SDK Version: 38.0.8
  2. Platforms(Android/iOS/web/all): Android

Expo standalone android app crashes with face detector error: Illegal argument exception: Invalid image data size

Hey @jaisabnis,

It’s going to be hard to help without seeing code. Can you share all the relevant code that is causing the crash?

Cheers,
Adam

The image shows the error I get once my app crashes.

<Camera
                style={styles.camera}
                type={this.state.type}
                ratio="16:9"
                pictureSize="16:9"
                flashMode={Camera.Constants.FlashMode.auto}
                onFacesDetected={this.handleFacesDetected}
                faceDetectorSettings={{
                  mode: FaceDetector.Constants.Mode.fast,
                  detectLandmarks: FaceDetector.Constants.Landmarks.all,
                  runClassifications:
                    FaceDetector.Constants.Classifications.all,
                  tracking: true,
                }}

I believe a solution might be adding some kind of error catching when there’s an error in detecting the faces, but I can’t think of a way to do that since the function handleFacesDetected can only run once the faces are detected, so I can’t add any try-catch argument within that function that will catch an error in the face detector itself not working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.