Skip to content
Advertisement

Camera 2 Api Error – the error that does not take pictures

I am having an issue with the Camera 2 Api.

When I try to take a picture it would not function. The system would not crash. The error only occurs when I try to take a picture.

Furthermore, I took all the permissions that I need in another activity.

The following error occurs.

JavaScript

I do not know if it has a relation with the error. Please use it as a reference.

I know that there are similar questions, but neither worked.

I deleted some codes. If you have any inconvenience please let me know.

Thank you in advance.

JavaScript

}

Advertisement

Answer

Could you try to request for the camera permission as the first thing before trying to take the actual picture? Maybe this is the reason it’s crashing.

Remove this permission part from your method “take picture”

JavaScript

You could execute it first before calling take picture

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement