Android摄像头相关问题记录
16lz
2021-01-23
Android摄像头Bug记录
1. Fail to connect to camera service,无法连接Camera服务
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.reeman.bigman/com.reeman.hellorobot.MainActivity}: java.lang.RuntimeException: Fail to connect to camera service
…
Caused by: java.lang.RuntimeException: Fail to connect to camera service
···
报错信息中提示无法连接到摄像头,可能情况及解决方法如下:
- 代码中打开的是否是对应的摄像头,如前置、后置、usb。
- AndroidManifest.xml中是否配置了相机权限
,另外,6.0以上的系统还需要动态过去权限。 - 设备中限制了该应用获取相机权限,需要在设备中找到权限管理中心手动赋予权限。
前面打开Camera后,在关闭时没有进行释放操作。释放操作的代码如下:
camera.stopPreview();
camera.release();
camera = null;
更多相关文章
- android常用权限
- android 调用摄像头
- android googlemap权限问题
- 【Android】自定义权限
- Android用户权限大全
- Android users-permission权限列表
- android AndroidManifest.xml 权限示例
- android 之摄像头
- Android多进程之Binder的意外死亡及权限校验