java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=27738, uid=10158 requires android.permission.WRITE_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

MANAGE_USERS has a protection level of signature|system, so your application must be signed with the platform key. Take a look on this https://goo.gl/nXsTvH for more information about it.

,
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

Solutions on the web

via Stack Overflow by user3655773
, 1 year ago
Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=27738, uid=10158 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
via GitHub by HanteIsHante
, 4 months ago
Destination must be on external storage: file:///Netfits_Android_2.3.1.2
via Stack Overflow by F1sher
, 2 years ago
Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=1380, uid=10136 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
via GitHub by Floens
, 1 year ago
Destination must be on external storage: file:///storage/external_SD/Clover/g_43297987/C64screen.jpg
via GitHub by iForests
, 1 year ago
Missing permission to insert badges
via GitHub by pedronveloso
, 1 year ago
Missing permission to insert badges
java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=27738, uid=10158 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1599)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
at android.content.ContentResolver.insert(ContentResolver.java:1251)
at com.scanlibrary.Utils.getUri(Utils.java:23)
at com.scanlibrary.PickImageFragment.postImagePick(PickImageFragment.java:146)
at com.scanlibrary.PickImageFragment.onActivityResult(PickImageFragment.java:141)
at android.app.Activity.dispatchActivityResult(Activity.java:6487)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3738)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3785)
at android.app.ActivityThread.access$1400(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)

Users with the same issue

Once, 1 day ago
Once, 4 weeks ago
Once, 1 month ago
Once, 1 month ago
7 times, 1 month ago

Write tip

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