When I am trying to run my application it throws the below error.
{System.NotImplementedException: 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. at Plugin.Permissions.CrossPermissions.get_Current () [0x00012] in :0 at XamarinStart.Detail+d__4.MoveNext () [0x00032] in D:\AmanahWork\XamarinStart\XamarinStart\XamarinStart\XamarinStart\Detail.xaml.cs:78 }
I have installed Plugin.Permissions in the main project also I have tried installing the reference to the Android and iOS project also but still, I am getting the same error.
Can anyone please help me on this.
The minimum compile target is MonoAndroid 7.1 for the current version of this plugin. You have to set this as the compile target in the settings of your project, or use an older version of the plugin.
The error message is not really helpful but the NuGet page shows the dependency requirements: Nuget
This is also explained by the plugin developer in the issue linked below : https://github.com/jamesmontemagno/PermissionsPlugin/issues/111
You have to install the Nuget package on both the main project as well as the platform projects.
You also need to add some initialization code, at least on Android, as pointed out on the project's website:
This plugin uses the Current Activity Plugin to get access to the current Android Activity. Be sure to complete the full setup if a MainApplication.cs file was not automatically added to your application. Please fully read through the Current Activity Plugin Documentation. At an absolute minimum you must set the following in your Activity's OnCreate method:
Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle);
https://github.com/jamesmontemagno/PermissionsPlugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With