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

Does not work for android 13 & above #21

Open
jaffar02 opened this issue Feb 5, 2024 · 1 comment
Open

Does not work for android 13 & above #21

jaffar02 opened this issue Feb 5, 2024 · 1 comment

Comments

@jaffar02
Copy link

jaffar02 commented Feb 5, 2024

Basic Information

Device type: Emulator
OS version: Android 13
EasyPermissions version: v1.0.0

Describe the problem

Application crashes if storage permission is requested on android 13 or above.

What happened? What did you expect to happen?
It should prompt request for storage permission on android 13 or above.

Code and logs

No such useful logs or any exception. Just crashes without any useful logs as soon as storage permission is requested.

if (hasReadExternalStorage()) {
   //perform something..
}else {
        EasyPermissions.requestPermissions(
                this,
                "This application must require this permission.",
                PERMISSION_REQUEST_CODE,
                android.Manifest.permission.READ_EXTERNAL_STORAGE
                )
}

private fun hasReadExternalStorage() = EasyPermissions.hasPermissions(
        this, android.Manifest.permission.READ_EXTERNAL_STORAGE)
@TwinkyMoon
Copy link

@jaffar02 probably you need follow behaviour changes and use other permissions for Android >= 13 https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions

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

2 participants