Camera Error on Nexus 6P
While this appears to run just fine on my Nexus 5 running 6.0, running this sample on a Nexus 6P causes CameraDevice.StateCallback.onError() to be called with error code 1 (This camera is already in use somewhere else) after a few seconds.
Steps to reproduce:
- Install on Nexus 6P
- Run. Accept permissions dialogs. Note camera preview working well.
- wait 2-3 seconds (do not press record button)
- onError gets called, and the activity finishes.
not working in HTC m8. i have try with permission WRITE_EXTERNAL_STORAGE but same result
android.hardware.camera2.CameraAccessException: The camera device has encountered a serious error
04-20 10:06:02.441 7414-7414/? W/System.err: at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1973)
04-20 10:06:02.441 1067-2831/? D/PMS: releaseWL(750c0a4): PARTIAL_WAKE_LOCK AudioIn 0x1 null
04-20 10:06:02.441 7414-7414/? W/System.err: at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureRequest(CameraDeviceImpl.java:623)
04-20 10:06:02.441 7414-7414/? W/System.err: at com.example.android.camera2video.Camera2VideoFragment.startPreview(Camera2VideoFragment.java:485)
04-20 10:06:02.441 7414-7414/? W/System.err: at com.example.android.camera2video.Camera2VideoFragment.stopRecordingVideo(Camera2VideoFragment.java:620)
04-20 10:06:02.441 7414-7414/? W/System.err: at com.example.android.camera2video.Camera2VideoFragment.onClick(Camera2VideoFragment.java:305)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.view.View.performClick(View.java:5226)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.view.View$PerformClick.run(View.java:21266)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.os.Handler.handleCallback(Handler.java:739)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.os.Looper.loop(Looper.java:168)
04-20 10:06:02.441 7414-7414/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5845)
04-20 10:06:02.441 7414-7414/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
04-20 10:06:02.441 7414-7414/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
04-20 10:06:02.441 7414-7414/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).
As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.
If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!