Search code examples
xamarin.formsfilepicker

Xamarin forms: Xamarin.Plugin.FilePicker is not working on ios


I am using Xamarin.Plugin.FilePicker to choose a file from the device.

Following is my code for picking a file from device:

var file = await CrossFilePicker.Current.PickFile();
if (file != null)
{
    filename_label.Text = file.FileName;
}

But this is not working on ios platform (Working fine on android and windows). Getting the below exception when running on ios simulator:

System.NotImplementedException has been thrown. This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

What I am missing on the ios part? Is this package only for android and windows?


Solution

  • System.NotImplementedException has been thrown. This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

    The error probably caused by the version of Xamarin.Forms or Mono SDK could not match with the version of the plugin . In your case , the latest version of plugin is 2.1.41. Which is released 7 days ago . Maybe it is still a beta version when you install it . So you could uninstall it and install an older version like 2.1.34 .