Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms : This functionality is not implemented in the portable version of this assembly

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.

like image 495
Hatim Ranapurwala Avatar asked Oct 20 '25 15:10

Hatim Ranapurwala


2 Answers

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

like image 109
Ruud Kobes Avatar answered Oct 23 '25 05:10

Ruud Kobes


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

like image 25
Gerald Versluis Avatar answered Oct 23 '25 04:10

Gerald Versluis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!