Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Denial: writing com.android.providers.media.MediaProvider #496

Closed
ajayamal opened this issue Jul 19, 2021 · 2 comments · Fixed by #871
Closed

Permission Denial: writing com.android.providers.media.MediaProvider #496

ajayamal opened this issue Jul 19, 2021 · 2 comments · Fixed by #871

Comments

@ajayamal
Copy link

ajayamal commented Jul 19, 2021

When i try to download an image from url i am getting this error W/System.err( 1845): java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=1845, uid=10513 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission() but i am using this plugin to download videos as well and its working fine on MP4

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

I tried adding these permissions it is still not working. PS(minSdkVersion: 23)

@bouziane
Copy link

I have same issue when i tried to read a mp3 file

java.lang.SecurityException: Permission Denial: reading vn.hunghd.flutterdownloader.DownloadedFileProvider uri content://com.sn114.flutter_downloader.provider/external_files/Download/audio-bande_annonce_en_bambara-_clv_feuilleton_radio-bm.mp3 from pid=4131, uid=10318 requires the provider be exported, or grantUriPermission()
E/DatabaseUtils(10811): 	at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:848)
E/DatabaseUtils(10811): 	at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:689)
E/DatabaseUtils(10811): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:244)
E/DatabaseUtils(10811): 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:106)
E/DatabaseUtils(10811): 	at android.os.Binder.execTransactInternal(Binder.java:1157)
E/DatabaseUtils(10811): 	at android.os.Binder.execTransact(Binder.java:1126)

@Andreigr0
Copy link

I believe this is the solution #773 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants