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()

Stack Overflow | user3655773 | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Android - Permission Denial (scanLibrary?!)

    Stack Overflow | 6 months ago | user3655773
    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()
  2. 0

    getApplicationContext() from fragment class

    Stack Overflow | 3 years ago | DharanBro
    java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=30912, uid=10091 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
  3. 0

    MediaStore.Images.Media.insertImage throwing permission denial on some devices

    Stack Overflow | 1 year ago | F1sher
    java.lang.SecurityException: 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()
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. balajivaishnav 1 times, last 11 months ago
1 unregistered visitors

Root Cause Analysis

  1. 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()
  2. Android Platform
    MediaStore$Images$Media.insertImage
    1. android.os.Parcel.readException(Parcel.java:1599)
    2. android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
    3. android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
    4. android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
    5. android.content.ContentResolver.insert(ContentResolver.java:1251)
    6. android.provider.MediaStore$Images$Media.insertImage(MediaStore.java:971)
    6 frames
  3. com.scanlibrary
    PickImageFragment.onActivityResult
    1. com.scanlibrary.Utils.getUri(Utils.java:23)
    2. com.scanlibrary.PickImageFragment.postImagePick(PickImageFragment.java:146)
    3. com.scanlibrary.PickImageFragment.onActivityResult(PickImageFragment.java:141)
    3 frames
  4. Android Platform
    ActivityThread.main
    1. android.app.Activity.dispatchActivityResult(Activity.java:6487)
    2. android.app.ActivityThread.deliverResults(ActivityThread.java:3738)
    3. android.app.ActivityThread.handleSendResult(ActivityThread.java:3785)
    4. android.app.ActivityThread.access$1400(ActivityThread.java:157)
    5. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
    6. android.os.Handler.dispatchMessage(Handler.java:102)
    7. android.os.Looper.loop(Looper.java:148)
    8. android.app.ActivityThread.main(ActivityThread.java:5525)
    8 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
    2 frames