0

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?

1
  • 1
    we can't debug code we can't see. Commented Jan 8, 2020 at 20:48

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, this helped me!!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.