Issue
I'm developing a flutter application. I've been using open_file package for quite a while now to open files, but suddenly it doesn't work. I tried altering the code to print out the result of envokeMethod, and this is what shows up in the terminal.
I/flutter (13494): Result: {"type":-3,"message":"Permission denied: android.Manifest.permission.MANAGE_EXTERNAL_STORAGE"}
I tried adding the permission MANAGE_EXTERNAL_STORAGE in AndroidManifest.xml, didn't work. I checked my app permission, it has access to file and media. Any help would be greatly appreciated. Thanks.
Solution
After looking for some stuffs, I finally found the problem. When I checked my app's permission, for some reason there are only 2 options in File and Media section, which are Media only and Deny. For some reason file isn't included there, so I looked it up and found out that you need a specific permission starting from Android 11, which is called manageExternalStorage. So I had to ask for storage permission, then manageExternalStorage permission, and only then I could see a third option in the File and Media permission, which is All Files. After applying and asking for that permission, open_file works perfectly fine.
Answered By - treble18
Answer Checked By - Marie Seifert (JavaFixing Admin)