I made a very, very small demo app reproducing the bug on a Nexus 5 running Android version 6.0.1. The app is on github here: https://github.com/lexi-sr/LayerPermission
I recently added 2 commits in which it targets API 23 and requests permissions at run time, but it still didn't work.
In these 2 commits, it has these settings:
- Target SDK: 23
- compiles Layer 0.20.3
1) In the commit "Removing layer dependency allows the popup dialog to request the perm…", where it does NOT have layer dependency:
The method ActivityCompat.requestPermissions
opens a dialog that requests the Contacts permission, and a log statement within the onRequestPermissionsResult
method logs that the permission has been granted.
2) In the commit "Requesting permissions does not work" where it DOES have layer dependency:
ActivityCompat.requestPermissions
does not open up any dialogs, but a log statement within onRequestPermissionsResult
still prints, logging that it does not have the permission.
It seems like adding the layer dependency is suppressing the ability to request for permissions at run time. Why is this happening?