W/CameraBase﹕ An error occurred while connecting to camera: 0

前端 未结 3 1712
走了就别回头了
走了就别回头了 2020-12-16 16:30

There was a similar question but it went unresolved:

W/CameraBase﹕ An error occurred while connecting to camera: 0 on camera.open() call

I have an app which

3条回答
  •  一个人的身影
    2020-12-16 17:08

    The "fail to connect to camera service" means that your (or some other) camera app has failed to release camera properly. This was happening to me occasionally as I was developing my app, too. The first thing I'd try is to open the camera from the default camera app that comes with the phone (just tapping the "camera" button). If that would fail to open, then the only option was to restart the phone.

    This is speculation, but your code might have a bug that surfaces only occasionally and it just didn't appear until now through pure luck. If it persist, check out the questions related to "how to release camera properly in android". They had helped me to deal with this.

提交回复
热议问题