java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/2821 from pid=26295, uid=10290 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

You need the permission android.permission.READ_EXTERNAL_STORAGE. Write <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> on the Android Manifest

,
Expert tip

Android SDK 23 introduced a new way to handle permissions, so as a temporary workaround you can set it to build for SDK below 23. As a permanent solution you have to ask user during runtime for permissions with checkSelfPermission() or requestPermissions()

Solutions on the web

via GitHub by timrijckaert
, 1 year ago
Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/2821 from pid=26295, uid=10290 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
via Stack Overflow by BP233
, 2 years ago
Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=2506, uid=10083 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
via Stack Overflow by Bhiefer
, 1 year ago
Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file from pid=3322, uid=10206 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
via 2cto.com by Unknown author, 1 year ago
Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/data/phones from pid=27697, uid=10194 requires android.permission.READ_CONTACTS, or grantUriPermission()
via Stack Overflow by vas
, 1 week ago
Selection not allowed for content://android.media.tv/program
via Stack Overflow by user2850116
, 2 years ago
Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=1071, uid=10066 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/2821 from pid=26295, uid=10290 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1620)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:491)
at android.content.ContentResolver.query(ContentResolver.java:434)
at com.usabilla.sdk.ubform.util.DataHelper.getRealPathFromURI(DataHelper.java:47)
at com.usabilla.sdk.ubform.data.Page.onActivityResult(Page.java:306)
at android.app.Activity.dispatchActivityResult(Activity.java:6456)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)

Users with the same issue

26 times, 1 year ago
2 times, 1 year ago
9 times, 1 year ago
8 times, 1 year ago
10 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.