Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Xam.Plugin.Media PickVideo crash on iOS 13

When choosing to pick a video from the gallery, the video is compressed but then the app crashes, with the exception saying access to the path denied. This looks to be only a bug on iOS 13.
I have followed the sample code how to use Xam.Plugin.Media and the app crashes on the below line
I am on the latest stable version of Xam.Plugin.Media
await CrossMedia.Current.PickVideoAsync();

The pick video option doesn't ask for an app name and directory name, this maybe the cause for the crash?
I have these permissions in my info.plist

This app needs access to the camera to take photos.
This app needs access to photos.
This app needs access to microphone.
This app needs access to the photo gallery.


  • ColeXColeX Member, Xamarin Team Xamurai
    edited September 2019

    I searched recent issue on github but did not find the similar case as yours , consider opening a new issue and it's better to attach the reproduction .

  • RobertDalyRobertDaly USMember ✭✭

    I received the same error and have seen other developers that have witnessed this. In my debug log I can pin-point the exception. It occurs when I retrieve a video from Photos and try to copy it to my local folder. This has always worked in every version prior to iOS 13.

    In my code, I merely do a copy of the .MOV file to my local folder. Don't have a clue as to why they changed it, but apparently is is using .../PluginKitPlugin as part of the path which was not used prior to this. This issue only affects videos - still images work fine (and they don't use the .../PluginKitPlugin.
    "Access to the path '/private/var/mobile/Containers/Data/PluginKitPlugin/63628C1F-5B66-4C40-ACF8-6B8F8E873254/tmp/trim.482CB0A5-ED17-4787-85E7-3543769A4054.MOV' is denied."

    I am searching for a work around. Are you (or have you) opened a new issue about this?

  • RobertDalyRobertDaly USMember ✭✭

    My solution worked. In my code I was using System.IO.File.Move(src, dest). Move does try to delete the original src, and I believe that is what is causing the exception. I changed the call to System.IO.File.Copy(src, dest) and all is right in the world! This happens if you are using Xam.Plugin.Media. Hope this helps you.

  • @RobertDaly I am having exactly the same issue. Your solution of using System.IO.File.Copy instead of System.IO.File.Move I don't quite understand how you implement that?

    In my app I am able to debug (debug iOS13.2 is not an easy task!) and the line I get the error on is:

            var file = await CrossMedia.Current.PickVideoAsync();

    When I step into that line (and in UI select a video and choose done) I get the error
    'Access to the path '/private/var/mobile/Containers/Data/PluginKitPlugin/-snip-/tmp/-snip-.MOV' is denied.'

    This worked in iOS12 but not in iOS13.
    It does work on a iOS13 simulator and I assume cause permissions are simply not in play there.

    As you can see I have no move or copy command here and this is why your solution confuses me.

    Can you clarify your solution a little more please?

    Chris ...

Sign In or Register to comment.