pretix / pretixdroid

Deprecated android application to check in your visitors with tickets generated by pretix
https://pretix.eu
GNU General Public License v3.0
32 stars 19 forks source link

java.lang.RuntimeException: getParameters failed (empty parameters) #2

Open ligi opened 8 years ago

ligi commented 8 years ago

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
ligi commented 8 years ago

just found https://github.com/dm77/barcodescanner/issues/235 which might be the source of this

jfwiebe commented 7 years ago

You can reproduce the error by removing the camera permisson again and than restart the app. device-2016-11-12-163443

raphaelm commented 7 years ago

Good catch! So we probably need to add

ligi commented 7 years ago

github.com/hotchemi/PermissionsDispatcher is really nice to handle runtime-permissions

deanveggy commented 6 years ago

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/).

raphaelm commented 5 years ago

e9eabc6 might fix this, let's see