-
Notifications
You must be signed in to change notification settings - Fork 876
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
Blacked preview screen on many devices #348
Comments
Hi @CodeCombiner thanks for using CameraKit. Could you fill out an issue template? That will help me get to the bottom of your problem. Thanks! |
Ok, I will install demo app and try to reproduce the issue. |
I am facing this issue as well. Testing on a Samsung Galaxy S6. Front camera seems to work fine, but back camera preview is a black screen. I toggle the facing with a button, and the method
Hopefully might help narrow down the possible cause of this issue. |
Hi all, recently experienced this using 0.13.1. Rear camera preview is pure black. Changing it back to 0.13.0 fixed it. Hope this resolves your issue as well. |
@kheldiente Thanks for the suggestion. Forgot to mention that I am using this (release v1.0.0 snapshot) |
@epekel Can you provide some screenshots or examples? We will push fixes to the 1.0.0 release addressing this if we can trace it down. Device and OS version would be helpful too. |
@austinkettner
( I capture the photo with the following line on capture button press: The issue is with the back camera, the preview screen (i.e. the layout below) is completely black when switched to the back camera. The front camera works though.
When trying to capture a photo in the back camera (with the preview being black), I get an NPE from the following code segment (decompiled CameraKitView.class, line with 3 asterisks on each side is where the exception happens):
The error reports that I am using a Samsung Galaxy S6 to test this, with the API level being 24 (Android 7.0) |
@austinkettner |
Kind of a late update but just wanted to let you know that this commit seems to fix the issue, at least for the device I am testing with. (I posted the comment above after this commit so it seems it was not a device specific issue after all) |
+1 same issue |
Unable to reproduce bug on Galaxy S5. However after reviewing the comments and going over commit history this PR is a potential candidate for the NPE: https://github.com/CameraKit/camerakit-android/pull/280/files There may be a condition not being caught when setting the previewSize. Will investigate further.. |
|
|
Yes it does exist facing same in samsung galaxy s5. My App was almost published and halted because of this. Could you plz give me another solution or reference to resolve this ASAP? |
Same here. Tested with beta3.9 on Nexus 5x with Android 8.0.1. No camera preview is shown, just a black screen. |
Hi @gsavvid and @shreekrishnaban can you post the code you are using to start the CameraKitView? |
@emersoncloud here's a simple demo app with a screenshot. I've tested it on my Nexus 5x Android 8.1.0 (not 8.0.1 like I accidentally wrote previously). https://github.com/gsavvid/camerakitplayground It might have to do something with the permissions because I don't get any prompt to grant them. Although when I tested it in my real app, the permissions were already granted but the result was the same as in the demo. |
On the latest beta, v1.0.0-beta3.9 you have to add two additional functions when creating a In the
Thanks for your demo code, it was very helpful! We are working on updated documentation for the final 1.0.0 release, clearing up these implementation issues. |
I was also having the issue where the preview showed up black. Tried all solutions given here and nothing worked, preview stayed black. After downloading the source code and adding it to my project I found out that resume() in CameraPreview.kt wasn't called and thus the preview didn't start. After digging a little further I noticed that the init call has a listener setup to wait for the surfaceView to become ready. The original code:
It appears that the lifecycleState isn't always RESUMED when onSurfaceReady is called.
The preview worked every single time. |
Having this problem with 1.0.0-beta3.11 with LG G4 (Device model LG-H815). Even tried with a 1.0.0-beta3.12 Snapshot with no luck. |
I had same problem with LG G4 and found it worked with 1.0.0-beta3.1 |
I observed the same 1.0.0-beta3.10 works for me, the newer milestones not. I suspect in the newer versions camera.onStart() and camera.onResume() conflict with each other. |
Same here, I'm using a Samsung Galaxy S8+ with Android 9. Preview seems to work fine if I use |
fixed the black preview issue downgrading from v1.0.0-beta3.11 to v1.0.0-beta2. Using Samsung GT-192000 with Android 7.0 |
In my case, I have fixed black preview by close another camera app. Black preview occur when camera opening by another application. |
I was conditionally adjusting camera view visibility, I also got blank screen. Calling onStop and onStart, when visibility is adjusted fixed it. |
Many devices display camera preview screen blacked. I think it might be a problem with autoexposure. The device have partial support of Camera2 API and are not legacy completely.
The text was updated successfully, but these errors were encountered: