-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
🐛 Camera has been disconnected #2257
Comments
+1 |
+1 |
I got this error too. If you're getting the error but can use the camera, you can use onError to prevent the error from appearing in the app. onError={handleCameraError}
|
I can't use the camera at all. It shows as a black screen. |
+1 But when I use codeScanner this error doesn't appear. |
+1 |
1 similar comment
+1 |
Change your conditional rendering logic like this:
|
It doesn't work anyway.. |
Facing the same issue. |
For me its super unstable and causes crashes everytime i either switch the camera It caused me a day of debugging, and it's still happening. Btw changing Apparently device can be undefined(i think). Which is contradictory to the docs. Thanks |
I'm going through the same problem. However, 25% of my app's user base are on Android version 12, making the use of the library unfeasible. |
+1 i noticed one thing when i change the navigator from bottom tab, the camera then works just fine
WhatsApp.Video.2023-12-20.at.2.10.52.PM.mp4 |
#2291 (comment) this solution worked for me for now |
Same problem when my camera app on from Instagram or other apk i cannot open camera in my app always disconect but when other apk camera close i Can open the camera in my apk |
I managed to solve this bug by activating the function App() {
const device = useCameraDevice('back')
if (!device) return null
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
photo={true}
video={true}
/>
)
} |
I think this has been fixed in the latest version (here on main) Please try the example app and let me know if the problem is gone! |
I'm still facing the same issue. I opened the example app and repeated flipping the direction. logs: https://gist.github.com/bglgwyng/cfe64520b4fbd56a5c74fb153e892f4d |
Is this fixed in 3.9.x @bglgwyng ? |
Nope, we're still experiencing this issue. Version 3.9.0 |
I'm facing the same issue on Android 12 when navigating between screens version: 3.9.0 |
Same here |
same here! |
Samsung S20FE / Android 13. Same error running the example app. |
The same in 3.9.2 but only crash on navigate to the other screen from the screen with camera. Any android emulator and physical device Samsung S23 - Android 14 Temporary fix - disable camera and then navigate with timeout 200-300 ms |
I'm getting this issue at 3.7.0 version, It's closed but I didn't get the resolution. |
Okk |
What's happening?
Hi everyone. I find myself surrounded by the darkest darkness trying to use the rear camera of my Motorola Moto g6 plus, since I'm getting multiple errors. When I navigate to the screen containing the Camera component this one shows up:
Camera.onError(session/camera-has-been-disconnected): [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: UNKNOWN_CAMERA_DEVICE_ERROR [session/camera-has-been-disconnected: [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: UNKNOWN_CAMERA_DEVICE_ERROR]
And then, navigating back and forth again I'm getting these other two
Camera.onError(unknown/unknown): [unknown/unknown] CameraDevice was already closed [unknown/unknown: [unknown/unknown] CameraDevice was already closed]
Camera.onError(session/camera-not-ready): [session/camera-not-ready] The Camera is not ready yet! Wait for the onInitialized() callback! [session/camera-not-ready: [session/camera-not-ready] The Camera is not ready yet! Wait for the onInitialized() callback!]
I don't want to leave without telling you that I've tested the native camera application of the phone and it's working properly, and that I have at least three other devices where the application that integrates react native vision camera, runs well. One of them is a Motorola Moto e6 Plus.
I would appreciate any kind of help/guidance to solve this issue. Thank you!
Reproduceable Code
Relevant log output
Camera Device
Device
Motorola Moto g6 Plus
VisionCamera Version
3.6.13
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Additional information
The text was updated successfully, but these errors were encountered: