-
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
Failed to configure camera #132
Comments
Should be fixed by #133. |
The error should be fixed in v3.2.0. The release also contains better preview scaling logic and uses TextureView by default, which should solve the sizing issues. Please re-open the issue if it is not solved yet. |
Everything work fine, but there is a bug on Android 6.0, when need to request permission. After permission granted camera not configure. Black window instead.
If reopen this activity, everything works fine. |
The library now has a built-in permission check. Can you test what happens if you remove this permission check logic? |
I used simple BarcodeView and without my permission check I receive an error
|
As I found your check logic used on CaptureManager, which used on CameraActivity only. I dont use CameraActivity, just BarcodeView class. |
You're right, I forgot that is only done in CaptureManager / CaptureActivity. I'll look into this. |
Ok. thanks. |
@rkistner Thanks in advance. |
The permission check is automatic if you use CaptureActivity. For CompoundBarcodeView there's not much that can be done in the library, since the permission request must happen on the Activity. I'll see if I can find a way to simplify it a bit for the next release. |
It's not a problem to write your own check logic. After permission granted camera not configure. Black window instead. I think you should fix this behavior, not permission build-in logic. |
@ramanbranavitski Yes, I'm also looking into that. I haven't been able to reproduce it yet though. Can you reproduce that on an emulator? I don't have a physical device with Android 6 unfortunately. |
Some bugs around permission handling may have been fixed since this issue was opened. Please create a new issue if this persists in v3.5.0. |
Problem still occurs in v3.5.0 and Android 6 but you can easily fix this by dynamically adding CAMERA permission (https://developer.android.com/training/permissions/requesting.html) |
Camera not working when rotating device.
Used TextureView, Nexus 9 (API 23)
Logs
D/CameraInstance: Opening camera D/CameraInstance: Closing camera D/CameraInstance: Opening camera D/CameraInstance: Configuring camera I/CameraManager: Camera Display Orientation: 90 W/CameraManager: Failed to set rotation. W/CameraManager: Camera rejected even safe-mode parameters! No configuration E/CameraInstance: Failed to configure camera E/CameraInstance: java.lang.RuntimeException: getParameters failed (empty parameters) E/CameraInstance: at android.hardware.Camera.native_getParameters(Native Method) E/CameraInstance: at android.hardware.Camera.getParameters(Camera.java:1890) E/CameraInstance: at com.journeyapps.barcodescanner.camera.CameraManager.setParameters(CameraManager.java:365) E/CameraInstance: at com.journeyapps.barcodescanner.camera.CameraManager.configure(CameraManager.java:141) E/CameraInstance: at com.journeyapps.barcodescanner.camera.CameraInstance$4.run(CameraInstance.java:178) E/CameraInstance: at android.os.Handler.handleCallback(Handler.java:739) E/CameraInstance: at android.os.Handler.dispatchMessage(Handler.java:95) E/CameraInstance: at android.os.Looper.loop(Looper.java:148) E/CameraInstance: at android.os.HandlerThread.run(HandlerThread.java:61) E/Camera: Error 2 E/Camera: Error 2 E/Camera: Error 2 E/Camera: Error 2 D/CameraPreview: pause() D/CameraInstance: Closing camera
May be there is a way to use SurfaceView and set its size equal to BarcodeView's size, not large?
Thank you.
The text was updated successfully, but these errors were encountered: