I’m developing a Flutter application where I need access to the user’s gallery (photos). I’m using the permission_handler package to request permissions. I’ve updated my AndroidManifest.xml to include the necessary permissions:
xml
Copy code
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
However, when I try to request gallery permissions in Flutter using:
Permission.photos.request();
I encounter this error in my logs:
No permissions found in manifest for: []9
I/flutter (30483): permission result: PermissionStatus.denied
Has anyone come across this issue when trying to access the gallery on Android 13+ using Flutter? How can I ensure permissions are correctly requested and granted for gallery images across different Android versions?
Given that READ_MEDIA_IMAGES should be the right permission for accessing photos on newer Android versions, I’m puzzled as to why I’m facing this denial.
2
Answers
You need add these permission for android 13 in the android manifest file
For more info and documentation
https://pub.dev/packages/permission_handler
Manifest file source code:
Dart file source code:
Dependent package: device_info_plus
I also want to pick the document in one project. So, I wrote this code. I tested code from SDK 29 to SDK 34 & it is working incredibly. Give it a try. All you need to call is the
permissionPhotoOrStorage()
function.