Skip to content Skip to sidebar Skip to footer

Failure Delivering Result - Cannot Execute Non-void Method OpenCamera

I'm using EasyPermissions library from Google to handle Permissions on Android 6. The first time I click the button to capture image it asks me to give permissions for CAMERA and f

Solution 1:

You get that exception because EasyPermission can't invoke your method openCamera since it has the parameter option. The methods annotated with AfterPermissionGranted must be void so EasyPermission can invoke them.

This condition is explicitly verified in the source of EasyPermission:

// Method must be void so that we can invoke it
if (method.getParameterTypes().length > 0) {
    throw new RuntimeException("Cannot execute non-void method " + method.getName());
}

To resolve the issue you must remove any parameter from the method openCamera.


Post a Comment for "Failure Delivering Result - Cannot Execute Non-void Method OpenCamera"