Android 6.0 RuntimeException: Fail to connect to camera service

后端 未结 5 1774
慢半拍i
慢半拍i 2021-01-17 07:36

An error occurred with my app which ran in Nexus5 (Android6.0).

The error was

java.lang.RuntimeException: Fail to connect to camera service

相关标签:
5条回答
  • 2021-01-17 08:15

    Write in your gradle.build targetSdkVersion 22. It is a temporary solution but work.

    0 讨论(0)
  • 2021-01-17 08:20

    Add Camera Permission before Opening the Camera:

    follow the Link for adding Permissions: https://developer.android.com/training/permissions/requesting.html

    0 讨论(0)
  • 2021-01-17 08:24

    open Settings -> Apps -> click you app -> Permissions -> open Camera permissions.
    you can see: http://developer.android.com/training/permissions/requesting.html

    0 讨论(0)
  • 2021-01-17 08:34

    From android 6.0 you can handle the app permission weather you will give or not specific permission for an application. In your case if you didn't enable camera permission for your app then this issues may arise.

    So, you need to enable permission from settings->apps->your_app->enable camera permission.

    0 讨论(0)
  • 2021-01-17 08:36

    This happens because, in Android 6.0 the permission model is different. You have to implement the new permission model which asks for the permission on run time. Even if you don't ask it, you can manually enable it in the phone's app setting, but that is not gona work when you publish your app in the play store. Here is an Article on How to get Run time permissions

    Also you can check Nick's answer here for getting multiple permissions

    0 讨论(0)
提交回复
热议问题