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

Camera is showing white screen instead of showing camera in android🐛 #855

Closed
3 of 4 tasks
humza-reignsol opened this issue Feb 28, 2022 · 6 comments · Fixed by #1466
Closed
3 of 4 tasks

Camera is showing white screen instead of showing camera in android🐛 #855

humza-reignsol opened this issue Feb 28, 2022 · 6 comments · Fixed by #1466
Labels
🐛 bug Something isn't working

Comments

@humza-reignsol
Copy link

What were you trying to do?

when I loaded the camera screen it is just showing white blank page.
if I resize camera, it start showing the actual camera screen but whenever I try to give width: ('Dimensions').width, height: ('Dimensions').height camera page is blank once again.
Flash is working fine but don't know why camera page is showing white blank page.
I'm attaching a screenshot below:

1646054120804

Reproduceable Code

<Reanimated.View style={StyleSheet.absoluteFill}>
            <TapGestureHandler onEnded={onDoubleTap} numberOfTaps={2}>
              <ReanimatedCamera
                ref={camera}
                style={StyleSheet.absoluteFill}
                device={device}
                format={format}
                fps={fps}
                hdr={enableHdr}
                lowLightBoost={device.supportsLowLightBoost && enableNightMode}
                isActive={isActive}
                onInitialized={onInitialized}
                onError={onError}
                enableZoomGesture={false}
                animatedProps={cameraAnimatedProps}
                photo={true}
                video={false}
                audio={hasMicrophonePermission}
                orientation="portrait"
              />
            </TapGestureHandler>
          </Reanimated.View>

What happened instead?

I have pasted the code I'm using.
Kindly correct me if I'm wrong somewhere.

Relevant log output

No response

Device

OPPO F-19, Techno Camon16

VisionCamera Version

^2.12.1

Additional information

@humza-reignsol humza-reignsol added the 🐛 bug Something isn't working label Feb 28, 2022
@mrousavy
Copy link
Owner

Hmm, are you running the example app without making any modifications?

@humza-reignsol
Copy link
Author

humza-reignsol commented Feb 28, 2022

Hmm, are you running the example app without making any modifications?

Pardon, it was an issue on my side.
I was trying to render camera in child view which caused this issue.
Thanks for your acknowledgement :)

@nachoSource
Copy link

nachoSource commented Jul 22, 2022

Hmm, are you running the example app without making any modifications?

Pardon, it was an issue on my side. I was trying to render camera in child view which caused this issue. Thanks for your acknowledgement :)

Well this is curious 😅 . Your answer helped me realise that Camera must be wrapped in <></> instead of a View component 🤔

@Brittognanaraj
Copy link

Brittognanaraj commented Feb 8, 2023

Try this one android:hardwareAccelerated=�false in AndroidManifest.xml makes the camera no longer display. Check your AndroidManifest and set it back to true may help the camera work again.

@mrousavy
Copy link
Owner

Ohh yea maybe the SurfaceView doesn't work then?

@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!

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