Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

WRITE_EXTERNAL_STORAGE permission should be removed for API >= 29 #443

Description

@saurabhSRJ

Expected Behavior

If your app targets Build.VERSION_CODES.R or higher, this permission has no effect
WRITE_EXTERNAL_STORAGE should be changed to READ_EXTERNAL_STORAGE

Actual Behavior

In the ImagePickerFragment you are asking for WRITE_EXTERNAL_STORAGE although only READ_EXTERNAL_STORAGE should be enough for our use case since this is being used as only image picker and not editing the image.

private val permission: String
        get() {
            return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                Manifest.permission.READ_MEDIA_IMAGES
            } else Manifest.permission.WRITE_EXTERNAL_STORAGE
        }

This should be changed to something like this:

private val permission: String
        get() {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                Manifest.permission.READ_MEDIA_IMAGES
            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                Manifest.permission.READ_EXTERNAL_STORAGE
            } else {
                Manifest.permission.WRITE_EXTERNAL_STORAGE
            }
        }

Steps to Reproduce the Problem

Specifications

  • Image Picker Version: 3.0.0
  • Android OS: 10-12
  • Phone:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions