Android 11 Permission Issue
1,755
We need to request manage_external_storage permission via permission_handler.
Add this permission to AndroidManifest.xml
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
Request permission as shown below
await Permission.manageExternalStorage.request();
Then we can read any file and write to any location in Android 11.
Author by
Himalay
Android Developer,Flutter Developer,Python Developer in GEC computer engineer with knowledge of high calculation in mathematics,understand issue quickly like compiler.
Updated on December 28, 2022Comments
-
Himalay over 1 year
my flutter code is
var storageInfo = await PathProviderEx.getStorageInfo(); var root = storageInfo[0] .rootDir; var fm = FileManager(root: Directory(root)); await fm.filesTree( excludedPaths: [ '/storage/emulated/0/Android', ], extensions: ['pdf'] );
error occur
E/flutter (16591): FileSystemException: Directory listing failed, path = '/storage/emulated/0/Android/obb' (OS Error: Permission denied, errno = 13) E/flutter (16591): #0 FileManager.dirsTree (package:flutter_file_manager/src/file_manager.dart:110:7) E/flutter (16591): #1 FileManager.filesTree (package:flutter_file_manager/src/file_manager.dart:132:34)
I have one issue to get list of files from stroage in android 11 from Flutter app
i already add both permission in AndroidManifest.xml file
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
-
blackapps about 3 yearsOn an Android 11 device you have no access to the../Android/obb directory. Not even with all files access.
-
Himalay about 3 yearsi went to read only specific extension file from storage
-
blackapps about 3 yearsNo you wanna list the obb directory i see.
-
Himalay about 3 yearsthen how can i retrieve document file list from storage
-
blackapps about 3 yearsPlease be exact. It cannot from obb directory you know now.
-
-
Dhaval Kansara about 2 yearswe can use this but Google Play console will not allow the app with this permission to release.