Permission
Camera2BasicFragment.java:514 "getActivity().checkSelfPermission(Manifest.permission.CAMERA)" call requires API level 23 but the current min set is 21. I'm testing in my phone that has API level 21 installed, what is the workaround or maybe deprecated version of 'checkSelfPermission'? Thank you very much.
Just need to change with the following code

I'm having the same issue. Thanks for the tip it works.
I would reclassify this as a bug, as the app flat out won't run on Android 5.x devices in its current state.
Thanks @rsegecin
The whole Camera2 API seems to be half-baked to me. CameraManager has setTorchMode method which is valid only API 23 onwards, but Camera2 itself is supported on API 21. Why the half-baked API?
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!