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

Viewed 1059

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?

2 Answers

Most probably you haven't configured your iCloud Driver (CloudKit). As it states in the project's documentation:

iOS: You need to Configure iCloud Driver for your app.

You can follow the steps and everything will be working in no time. This is needed, since on iOS you don't have a "simple" file system, to choose your file from. It needs to go "through" iCloud.

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 .

Related