Making myself a bit more clear. I have an app in which I need to allow the permission for using Camera. My application also asks for the permission to access location for which I took the id of the Allow button of the alert and clicked on it. It worked there. But when I tried the same thing with the Camera permission, it didnāt work. I enabled the auto grants of permissions, the pop-up didnāt come but later on I got NoSuchElement Exception.