Camera is not loading on certain devices.
What were you trying to do?
The Camera is working fine on most devices. However, there are a few on which it just won't work. The camera will simply try to load and stay black.
Samsung S22 Ultra | SM-S908B | Android 13 Huawei | MAR-LX1B | Android 10
It might be related to https://github.com/mrousavy/react-native-vision-camera/issues/238
Sadly, I have no logs seeing as I do not own the phones mentioned and have no access to these phones, yet.
What happened instead?
The camera did not load correctly.
Device
As mentioned above
VisionCamera Version
2.15.2
Additional information
- [ ] I am using Expo
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar issues in this repository and found none.
Try disabling frame processors. Also, see which device and formats itβs using. I can confirm that it works on the S22 ultra.
@xtl-geiger are you rendering it inside Modal?
I was using useCameraDevices('wide-angle-camera') and it is returning only front camera on S22 Ultra, other ones are undefined. So @xtl-geiger maybe it is the same case for you? useCameraDevices() solves it for me
Try disabling frame processors. Also, see which device and formats itβs using. I can confirm that it works on the S22 ultra.
@hocaltar What camera device and format are you using?
I was using useCameraDevices('wide-angle-camera') and it is returning only front camera on S22 Ultra, other ones are undefined. So @xtl-geiger maybe it is the same case for you? useCameraDevices() solves it for me
Same on S23 Ultra
Try this https://www.youtube.com/playlist?list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i
@ManarHussein hey! I have the same issue and I am rendering the camera view in a modal. Mine works fine for other android devices, but we have this problem with the Xiaomi Redmi 9A, Android Version 10. If you click on the camera, it just shows a loader and nothing else. I'm also using useCameraDevices() but I don't pass anything. Also, for the modal, I implemented this hook: = gestureHandlerRootHOC() because otherwise it wasn't zooming. Any thoughts?
We have the exact same issue with Android 13, Xiaomi POCO X4 Pro 5G,
using const devices = useCameraDevices('wide-angle-camera')
To resolve the problem, you can simply remove the 'wide-angle-camera' parameter, like this: const devices = useCameraDevices();
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of β¨ VisionCamera V3.
I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here?
Here's an instruction on how you can test that: https://github.com/mrousavy/react-native-vision-camera/pull/1674#issuecomment-1684104217
If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! π Otherwise please let me know and I'll keep this issue open to keep track of it.
Thank you!
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of β¨ VisionCamera V3.
I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here?
Here's an instruction on how you can test that: #1674 (comment)
If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! π Otherwise please let me know and I'll keep this issue open to keep track of it.
Thank you!
Hi, I have same issues with some phones not opening camera, how can I npm install the new V3 version? Do i have to change code or syntax for this rewrite?
Appreciate so much.
Alejandro