ParkSangGwon/TedPicker

RunTimeException: Unknown Camera ID

Tunder1992 opened this issue · 0 comments

During development of an app of mine I encounter the following error from time to time on my Nexus 6P.

Fatal Exception: java.lang.RuntimeException: Unknown camera ID at android.hardware.Camera._getCameraInfo(Camera.java) at android.hardware.Camera.getCameraInfo(Camera.java:236) at com.commonsware.cwac.camera.CameraView.getCameraPictureRotation(CameraView.java:625) at com.commonsware.cwac.camera.CameraView.access$100(CameraView.java:38) at com.commonsware.cwac.camera.CameraView$OnOrientationChange.onOrientationChanged(CameraView.java:655) at android.view.OrientationEventListener$SensorEventListenerImpl.onSensorChanged(OrientationEventListener.java:143) at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:481) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:323) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5422) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

I have no clue how I can process this error so I can just provide an dialog to the user asking to restart the app instead. While reading the cwac-cam library you use I found that they provide an onCameraFail method. Could you perhaps assist me in finding a solution for this? :)

Thanks alot!! Love your work.