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

🐛 On android device unable to get reference of camera, on iOS it is working fine. #1646

Closed
3 of 4 tasks
zainlinux1989 opened this issue Jul 7, 2023 · 4 comments · Fixed by #1466
Closed
3 of 4 tasks
Labels
🐛 bug Something isn't working

Comments

@zainlinux1989
Copy link

What were you trying to do?

"react": "18.2.0",
"react-native": "0.71.10",
"react-native-vision-camera": "2.15.4",

const isFocused = useIsFocused();
<Camera
     ref={cameraRef}
     style={style.camera}
     device={device}
     isActive={isFocused}
     video={true}
     audio={true}
/>

Reproduceable Code

No response

What happened instead?

for android case i am reloading view until it get the reference of camera.

Relevant log output

No response

Device

Android

VisionCamera Version

2.15.4

Additional information

@zainlinux1989 zainlinux1989 added the 🐛 bug Something isn't working label Jul 7, 2023
@danstepanov
Copy link
Sponsor

Pls fix

@fukemy
Copy link

fukemy commented Jul 12, 2023

Hi, which is reference of camera., did you mean you are doing some code with cameraRef but first time it's undefined?

@mrousavy
Copy link
Owner

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!

@zainlinux1989 zainlinux1989 changed the title 🐛 On android device unable to get reference of camera, on iOS it is working find. 🐛 On android device unable to get reference of camera, on iOS it is working fine. Sep 1, 2023
@zainlinux1989
Copy link
Author

@mrousavy Thank you for doing your hard work, I have not checked but i hope this will be helpful for all. I will use it in our upcoming project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants