Reputation: 116
I am currently trying to make a Youtube Music downloader for Android in Xamarin. When I want to download the file, I get this error:
Error:"System.UnauthorizedAccessException: 'Access to the path "/storage/emulated/0/Download/Video Title.mp3" is denied.
I gave the app permission to write but I still get this Error. Why?
Upvotes: 0
Views: 655
Reputation: 657
If you are targeting anything above android Marshmallow, not all permissions are going to be granted even if specified in the Manifest.
1) You need to specify the permissions you'll need (in this case read/write permissions maybe?) in the manifest.
2) You'll need to request permissions during runtime using PermissionsPlugin (developed by good old James Montemagno!).
It's a really nice permissions library that's crazy simple to use. Go check it out and see if this fixes your issue.
Upvotes: 1