Skip to content

Permissions not being enabled eventhough permission status says PermissionStatus.allow #18

@fritz-playmaker

Description

@fritz-playmaker

I am successfully requesting permission for Storage ad Microphone and my log indicates that permissions are allowed. But the moment i attempt to record an audio, the app crashes indicating that the Permissions have not been granted. After running the app 2 to 3 times, the permissions finally gets enabled. Great library but not reliable at the moment. Android manifest has the permissions inserted also.

##Log Indicating Successful activation of Permissions

I/flutter (27786): PermissionName.Microphone: PermissionStatus.allow
I/flutter (27786): PermissionName.Storage: PermissionStatus.allow

##Error Log when trying to record an audio
E/flutter (27786): Exception: PlatformException(FlutterSoundPlugin, NO PERMISSION GRANTED, android.permission.RECORD_AUDIO or android.permission.WRITE_EXTERNAL_STORAGE)

##Android Manifest Permissions

   <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.LOCATION"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

###Code for requesting Permissions

 Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler()
        .requestPermissions([
      PermissionGroup.storage,
      PermissionGroup.speech,
      PermissionGroup.camera,
      PermissionGroup.location
    ]);
    print(permissions.toString());
  }

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