pretixdroid
pretixdroid copied to clipboard
java.lang.RuntimeException: getParameters failed (empty parameters)
Wast just opening the app again as I was setting up a pretix installation. Unfortunately the first time opening the app crashed and even worse I cannot reproduce this anymore currently. Opening the app after this and until now worked like a charm.
11-02 21:29:24.176 515 2358 W QCamera2Factory: getCameraInfo: E, camera_id = 0
11-02 21:29:24.176 515 2358 I QCamera2HWI: getFlashInfo cameraId:0 hasFlash:1
11-02 21:29:24.176 515 2358 I QCamera2HWI: getCapabilities id:0 hasFlash:1
11-02 21:29:24.176 515 2358 W QCamera2HWI: __dbg: info->orientation : 90 rc = 0
11-02 21:29:24.176 515 2358 W QCamera2Factory: getCameraInfo: X
11-02 21:29:24.176 515 2358 W QCamera2Factory: cameraDeviceOpen : E
11-02 21:29:24.176 13358 13358 E AndroidRuntime: FATAL EXCEPTION: main
11-02 21:29:24.176 13358 13358 E AndroidRuntime: Process: eu.pretix.pretixdroid.debug, PID: 13358
11-02 21:29:24.176 13358 13358 E AndroidRuntime: java.lang.RuntimeException: getParameters failed (empty parameters)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.hardware.Camera.native_getParameters(Native Method)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.hardware.Camera.getParameters(Camera.java:1996)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at me.dm7.barcodescanner.core.CameraUtils.isFlashSupported(CameraUtils.java:47)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at me.dm7.barcodescanner.core.BarcodeScannerView.setFlash(BarcodeScannerView.java:153)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at me.dm7.barcodescanner.core.BarcodeScannerView.setupCameraPreview(BarcodeScannerView.java:90)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at me.dm7.barcodescanner.core.CameraHandlerThread$1$1.run(CameraHandlerThread.java:31)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.os.Looper.loop(Looper.java:158)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7225)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
11-02 21:29:24.176 13358 13358 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
11-02 21:29:24.176 515 2358 I QCamera2HWI: [KPI Perf] openCamera: E
11-02 21:29:24.176 515 2358 W QCamera2HWI: [CORELOCK_DBG] perf_lock_acq was called by openCamera
11-02 21:29:24.176 515 2358 W QCamera2HWI: [CORELOCK_DBG] perf_lock_acq limit max clock for protection peak current!!. mPerfMaxLockHandle = 40
11-02 21:29:24.176 515 2358 I QCamera2HWI: getFlashInfo cameraId:0 hasFlash:1
just found https://github.com/dm77/barcodescanner/issues/235 which might be the source of this
You can reproduce the error by removing the camera permisson again and than restart the app.
Good catch! So we probably need to add
- more permission checks
- find out why it occured for @ligi
github.com/hotchemi/PermissionsDispatcher is really nice to handle runtime-permissions
had same issue. fixed by explicitly requesting camera permission before switching to the page containing the code that uses the camera. in my case zxing scanner for xamarin. It's a messy business due to different android versions so i used of a great NuGet plugin (helper). PlugIn.Permissions (https://www.nuget.org/packages/Plugin.Permissions/).
e9eabc6 might fix this, let's see