System.NotImplementedException: 'This functionality is not implemented in the portable version of this assembly

Viewed 3954

I have added Plugin.MediaManager and Plugin.MediaManager.Forms into my xamarin forms project for playing video.

CrossMediaManager.Current.Init(this);

when I am trying to add above code, it shows error (No overload for method Init();)

But getting below exception on android when running the project with below line of code.

CrossMediaManager.Current.Init();

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.'

IOS and UWP apps are working fine, only android project has this issue. Please help me to fix this.

3 Answers

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.'

The above error often appears when the version of Android target is lower . Here is a similar issue that you can check https://github.com/martijn00/XamarinMediaManager/issues/437 .

In addition, in your case . You should make sure the format of video url is xxx.mp4 .The plugin couldn't support the url with such a format(player.vimeo.com/video/361089481).

I have updated the compile version to 10.0 and worked for me.

Android project referring to the net standard 2.0, So the init method was not taking a parameter. I looked into the plugin.mediamanager package folder for android dll and it was monoandroid10.0

enter image description here

enter image description here

On previous versions of this plugin the init for Android is:

CrossMediaManager.Current.Init();

I just updated all packages in nuget including xamarin.forms, changed the Target framework to API 29 and changed in Android the

CrossMediaManager.Current.Init();

to

CrossMediaManager.Current.Init(this);

and works now.

  • Plugin.MediaManager v0.9.7
  • Plugin.MediaManager.Forms v0.9.7
  • Xamarin.Forms v4.5.0.495
Related