RuntimeException: getParameters failed (empty parameters)
See original GitHub issueIn 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)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Correct handling of exception: "getParameters failed (empty ...
1) Probably the most common reason would be closing/releasing the camera while still using it afterward. This can be especially problematic if you...
Read more >RuntimeException: getParameters failed (empty parameters ...
The app crashes when navigating away from the scanner page, then back to the scanner page. Also when changing the orientation by rotating ......
Read more >RuntimeException: getParameters failed (empty parameters)
getParameters failed (empty parameters) java.lang.RuntimeException: getParameters failed (empty parameters) at android.hardware.Camera.
Read more >Taking a picture exception (getParameters failed) using ...
RuntimeException : getParameters failed (empty parameters). This error occurs immediately following the clicking of the OK to accept the ...
Read more >8258 - Create camera error: Fatal Exception: java.lang ...
Fatal Exception : java.lang.RuntimeException: getParameters failed (empty parameters) at android.hardware.Camera.native_getParameters(Camera.java)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed released in v3.5.0.
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 e3aed41746c33a72471f8aab16e5186ee4a5502c. 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 2cf4b60f0f1fb6181d0a0e5f6eee94803173364f. 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.