react-native-vision-camera: ๐ 3.6.17 Android Regression: Camera blacks out on Android (working fine on 3.6.16)
Whatโs happening?
Iโve started to encounter a black screen on Android while working in development mode, <Camera />
starts black and stays black 100% of the time. I can fix it by adding a timeout to toggle the the isActive prop after one second.
It used to work flawlessly before (same device same OS version) ~but Iโm not sure which version introduced the regression as I develop mainly on iOS. Could try to bisect the version if interested~. The regression did occur in latest 3.6.17
has it does work correctly using the previous 3.6.16
release.
Culprit is probably https://github.com/mrousavy/react-native-vision-camera/commit/977bf56c6de70c981b87991dcf5b0a69b9ed66e1
Iโve captured two adb traces, one when the bug occurs, one with a working start with the timeout.
There seems to be related issues but not exactly the same:
- https://github.com/mrousavy/react-native-vision-camera/issues/2330
- https://github.com/mrousavy/react-native-vision-camera/issues/2301
Reproduceable Code
const devices = useCameraDevices();
const device = devices.find(({position}) => position === 'back');
return <Camera
style={StyleSheet.absoluteFill}
device={device}
resizeMode="contain"
/>
Relevant log output
https://gist.github.com/mgcrea/8bce7771c8dbca5fdd1c0358c89fcd9e
Camera Device
{
"sensorOrientation": "landscape-right",
"hardwareLevel": "full",
"maxZoom": 8,
"minZoom": 1,
"maxExposure": 72,
"supportsLowLightBoost": false,
"neutralZoom": 1,
"physicalDevices": [
"wide-angle-camera"
],
"supportsFocus": true,
"supportsRawCapture": true,
"isMultiCam": false,
"minExposure": -72,
"name": "BACK (0)",
"hasFlash": true,
"hasTorch": true,
"position": "back",
"id": "0"
}
Device
OnePlus 6
VisionCamera Version
3.6.17
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information
- I am using Expo
- I have enabled Frame Processors (react-native-worklets-core)
- I have read the Troubleshooting Guide
- I agree to follow this projectโs Code of Conduct
- I searched for similar issues in this repository and found none.
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Reactions: 10
- Comments: 18 (4 by maintainers)
I have this same issue using 3.6.17 with RN 0.73.1. Switching to 3.6.16 gets rid of the issue.
For me this worked-
Hey! Thanks for reporting this issue.
Iโve been working the past days on making sure the Camera lifecycle is safely handled and released when needed, so this crash doesnโt occur anymore.
I just created a PR for this - can you please this to see if that fixes the issue for you? https://github.com/mrousavy/react-native-vision-camera/pull/2339
If this fixes your issue, please consider ๐ sponsoring me on GitHub ๐ to support me / thank me for building VisionCamera and continuously improving it.
If this does not fix your issue, please clone the repo, check out the branch
fix/blackscreen
(the PR above), run the Example app, reproduce your issue there and share theadb logcat
logs with me (upload to pastebin or gist) so I can investigate this further.Thank you! ๐