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

RuntimeException: getParameters failed (empty parameters) #270

Closed
PaulWoitaschek opened this issue Jan 23, 2017 · 8 comments
Closed

RuntimeException: getParameters failed (empty parameters) #270

PaulWoitaschek opened this issue Jan 23, 2017 · 8 comments

Comments

@PaulWoitaschek
Copy link
Contributor

In my crashlogs I see a few RuntimeException where getParameters crashed. It appears for various devices, so far all API 23 and 24.

Exception java.lang.RuntimeException: getParameters failed (empty parameters)
android.hardware.Camera.native_getParameters (Camera.java)
android.hardware.Camera.getParameters (Camera.java:1951)
com.journeyapps.barcodescanner.camera.CameraManager.isTorchOn (CameraManager.java:470)
com.journeyapps.barcodescanner.camera.CameraManager.setTorch (CameraManager.java:449)
com.journeyapps.barcodescanner.camera.CameraInstance$1.run (CameraInstance.java:139)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:234)
android.os.HandlerThread.run (HandlerThread.java:61)
@pduartee
Copy link

pduartee commented Mar 1, 2017

I'm getting a similar issue, randomly on one device (Asus Zenfone Pegasus 3). API 23
Lib version: 3.3.0. I'll re-validate with the new 3.4.0

Update: Still happens on 3.4.0

Exception [REVISION: 85538] caught=java.lang.RuntimeException: getParameters failed (empty parameters)
at android.hardware.Camera.native_getParameters(Native Method)
at android.hardware.Camera.getParameters(Camera.java:3113)
at com.journeyapps.barcodescanner.camera.CameraManager$CameraPreviewCallback.onPreviewFrame(CameraManager.java:103)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1281)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.os.HandlerThread.run(HandlerThread.java:61)

@PaulWoitaschek
Copy link
Contributor Author

I'd be happy to make a PR. But as my current pull request is open for about 3 month now I'm not sure if this project is abandoned?

@rkistner
Copy link
Member

@PaulWoitaschek Did you manage to find the issue? Issues like this are often device-specific, which makes it very difficult to debug without the device.

The project is not abandoned, but I have been slow with maintenance over the last few months. Looking at your PR now.

@nikeru8
Copy link

nikeru8 commented Mar 16, 2017

device: Redmi Note 4
Version: 6.0
crash location: BarcodeScannerView.java line 155 in BarcodeScannerView.setFlash()

@rkistner
Copy link
Member

These errors are difficult to debug. It could be due to state management issues (still using the camera after it has been closed), or due to to a bug in the Camera framework of the device.

The best I can do for now is handle these errors by logging them, instead of letting the application crash.

@PaulWoitaschek Added a workaround for your issue in e3aed41. The stack trace seems related to the torch, so it should be OK to just ignore the error.

@therottman Added workaround for your issue in 2cf4b60. In this case it's an error when receiving a preview frame. If this happens either as a once-off frame issue, or because we were already closing the camera, the workaround should solve the issue. If it happens repeatedly, there may be a deeper underlying issue we'll have to investigate.

@nikeru8 Your issue may be the same as @PaulWoitaschek. If not, I'll need a proper stack trace to investigate.

@rkistner
Copy link
Member

Fixed released in v3.5.0.

@pduartee
Copy link

Tks! :)

@rastoabh19
Copy link

I'm facing similar issue on Motorola Moto G5 running on Android Nougat 7.0
Sourcecode : https://github.com/jfversluis/ZXingSample.git
Btw, sample code is working perfectly fine on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants