Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
saurabhSRJ opened this issue Jun 24, 2023 · 4 comments
Open

Comments

@saurabhSRJ
Copy link

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:
@iip-ritase
Copy link

any workaround before team fix it?

@mzekrallah
Copy link

any fix for this ? its causing issue in opening the picker permissions for devices who were on older android versions and then upgraded .. with no solution other than uninstall + install the app again to fix it

@esafirm
Copy link
Owner

esafirm commented Oct 9, 2023

@mzekrallah @iip-ritase is there any sample or video about this issue? Also, feel free to push a PR for this

@dicksonNG
Copy link

@esafirm i have the same issue with below image
My device OS version is 31
螢幕截圖 2023-12-20 下午5 07 08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants