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

[Android 10] WRITE_EXTERNAL_STORAGE Permission Denied #108

Open
rlekqls12 opened this issue Nov 12, 2019 · 4 comments
Open

[Android 10] WRITE_EXTERNAL_STORAGE Permission Denied #108

rlekqls12 opened this issue Nov 12, 2019 · 4 comments

Comments

@rlekqls12
Copy link

rlekqls12 commented Nov 12, 2019

It used well in the existing API26, but it does not run after updating to Android 10.
The TED Permission says that you have permission, but when you actually run the file save code, you get a Permission Denied.

So I am temporarily using the code below.
The code below works fine.

    String[] permissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE};
    requestPermissions(permissions, 0);
    @Override
    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
        switch (requestCode) {
            case 0:
                if(grantResults != null || grantResults.length != 0 || grantResults[0] == PackageManager.PERMISSION_GRANTED){
                    //Granted.
                    Log.d(TAG, "PERM GRANTED");
                }
                else{
                    //Denied.
                    Log.d(TAG, "PERM DENIED");
                }
                break;
        }
    }

You can use this code to verify that you have obtained the right permissions.

int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE);

                if(permissionCheck == PackageManager.PERMISSION_DENIED){
                    Log.d(TAG, "PERMISSION DENIED");
                }else{
                    Log.d(TAG, "PERMISSION GRANTED");
                }
@FaisalFiyyaz
Copy link

FaisalFiyyaz commented Nov 13, 2019

I am having same issue as @rlekqls12

@MoNTE48
Copy link
Contributor

MoNTE48 commented May 13, 2020

@ParkSangGwon
Copy link
Owner

@rlekqls12
Did you check scoped storage?

@ArleyPereira
Copy link

ArleyPereira commented Oct 10, 2020

AndroidManifest.xml

error:
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"

Success:
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"

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