skip to Main Content

‘Permission denied’ issue even after granting. Issue is only with Samsung galaxy devices. I am using galaxy A14.

Android Manifest File:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

see screenshot of app setting here

here I cant see any storage permission to allow from settings.
when I printed the storage permission status it show denied.

2

Answers


  1. Can you please share the log of issue , so anyone understand easily! thanks

    Login or Signup to reply.
  2. try adding these permissions too

    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
    

    then check then version and handle accordingly

    Future<void> _getStoragePermission() async {
        DeviceInfoPlugin plugin = DeviceInfoPlugin();
        AndroidDeviceInfo android = await plugin.androidInfo;
           if (android.version.sdkInt < 33) {
              if (await Permission.storage.request().isGranted) {
                 setState(() {
                   permissionGranted = true;
                 });
              } else if (await Permission.storage.request().isPermanentlyDenied) {
                 await openAppSettings();
              } else if (await Permission.audio.request().isDenied) {
                 setState(() {
                   permissionGranted = false;
                 });
              }
            } else {
               if (await Permission.photos.request().isGranted) {
                    setState(() {
                       permissionGranted = true;
                    });
               } else if (await Permission.photos.request().isPermanentlyDenied) {
                   await openAppSettings();
               } else if (await Permission.photos.request().isDenied) {
                   setState(() {
                       permissionGranted = false;
                   });
             }
          }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search