An error occurred with my app which ran in Nexus5 (Android6.0).
The error was
java.lang.RuntimeException: Fail to connect to camera service
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.