Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix capture/no-valid-data thrown when calling stopRecording() on some Android devices #2466

Conversation

jblarriviere
Copy link

What

This PR fixes the crash happening on some Android devices while trying to record a video with the front camera (described in #2428)

Changes

Call preview.setSurfaceProvider() before calling cameraProvider.bindToLifecycle() as recommended here

The bug is known in CameraX and has been fixed in 1.2.x but not backported to 1.1.x
This is the recommended workaround

Tested on

Related issues

Copy link

vercel bot commented Jan 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 2:46pm

@jblarriviere jblarriviere changed the title fix: capture/no-valid-data thrown when calling stopRecording on some Android devices (#2428) fix: capture/no-valid-data thrown when calling stopRecording on some Android devices Jan 31, 2024
@mrousavy
Copy link
Owner

Cool, looks good - I didn't test it but I think we can merge.

@mrousavy mrousavy changed the title fix: capture/no-valid-data thrown when calling stopRecording on some Android devices fix: Fix capture/no-valid-data thrown when calling stopRecording() on some Android devices Jan 31, 2024
@mrousavy mrousavy merged commit 377264d into mrousavy:v2 Jan 31, 2024
3 of 5 checks passed
j-piasecki pushed a commit to j-piasecki/react-native-vision-camera that referenced this pull request Feb 12, 2024
…` on some Android devices (mrousavy#2466)

fix: crash recording with front camera on android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants