Permission ACCESS_ALL_DOWNLOADS in Android when trying to load a file path
20:39 05 Jul 2019

I've been trying to find the answer without success for this exception that is being thrown when I pick a file from the downloads folder on API 28, which ends up being cached as a fallback and retrieved the path nevertheless.

TL;DR: What do I need to fix this exception?

java.lang.SecurityException: Permission Denial: reading 
com.android.providers.downloads.DownloadProvider uri 
content://downloads/all_downloads/40 from pid=13467, uid=10091 requires 
android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()

Things I've already tried so far:

Add this to the manifest file:

   
    
    
    

and requesting Manifest.permission.WRITE_EXTERNAL_STORAGE in runtime.

android download path permissions provider