Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Environment Details
Dependencies & SDK
Steps to Reproduce
Error
Issue Details
GrantPermissionRule rule is applied within android instrumentation tests to grant runtime permissions. This will prevent user dialog confirmation and helps with UI testing. However, adding this rule is failing to grant requested permissions (Manifest.permission.WRITE_EXTERNAL_STORAGE & Manifest.permission.READ_EXTERNAL_STORAGE) with the above error. Some developers were able to get it working by applying permissions within androidTest/AndroidManifest.xml or debug/AndroidManifest.xml but this is different from runtime permissions.
Link:https://cs.android.com/androidx/android-test/+/master:runner/rules/java/androidx/test/rule/GrantPermissionRule.java?q=file:androidx%2Ftest%2Frule%2FGrantPermissionRule.java%20class:androidx.test.rule.GrantPermissionRule