I am doing an application to scan barcodes on a button click and it was working fine up to Lollipop versions. When I came to Marshmallow it stopped working. This is the erro
After having it defined in your manifest file, a friendlier alternative to the native solution would be using Aaper: https://github.com/LikeTheSalad/aaper like so:
@EnsurePermissions(permissions = [Manifest.permission.CAMERA])
private fun takePhoto() {
// Your code that needs the camera permission granted.
}
Disclaimer, I'm the creator of Aaper.