Skip to content

SecurityException in Version 2.2.0 when trying to display the image from the Gallery #212

@vanniktech

Description

@vanniktech

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When selecting a picture from the Gallery and opening it with uCrop, via the returned Uri from the onActivityResult intent, the app will crash:

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

What is the expected behavior?
To not crash and nonetheless display the chosen picture as it was done in version 1.5.0 of the library.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Let the user choose a picture from the gallery
  2. Take the Uri from the onActivityResult callback and open uCrop with it
  3. App will crash

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop?
Android versions affected: >= Marshmallow
Version 2.2.0 of uCrop is affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions