-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Black Screen, no Camera Preview #299
Comments
How did you solved this issue ? |
That seems to be Camera API 2 - it's not supported yet by this library. |
Hey @dhruv2601, How did you fix this issue? |
I'm having the same issue on Android 9 |
I faced the same issue. But in my case, I got the following from the logs
So I just set the hardware acceleration for the activity in the manifest file. and It worked.!
|
!!! android:hardwareAccelerated="true" !!! |
Description of the problem:
When I am using the below code to access the barcode scanner camera then as in the below image, a black screen covers what should have been the camera instead.
I have made sure that the camera permission is granted.
` <com.journeyapps.barcodescanner.DecoratedBarcodeView
android:id="@+id/scanner"
android:layout_width="match_parent"
android:layout_height="200dp"
app:zxing_preview_scaling_strategy="centerCrop"
app:zxing_use_texture_view="false" />
`
My need is to reduce the size of the scanning camera to a given size ex -> as in the figure, so if there is a way around that, then please mention that.
Which library version are you using? 3.5.0.
Logs:
05-23 00:37:34.082 3062-3103/com.raywenderlich.alltherages E/CameraInstance: Failed to open camera
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:568)
at android.hardware.Camera.open(Camera.java:405)
at com.google.zxing.client.android.camera.open.OpenCameraInterface.open(OpenCameraInterface.java:83)
at com.journeyapps.barcodescanner.camera.CameraManager.open(CameraManager.java:138)
at com.journeyapps.barcodescanner.camera.CameraInstance$3.run(CameraInstance.java:190)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
The text was updated successfully, but these errors were encountered: