5

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.

Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105

3 Answers3

4

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

Lucas Zhang
  • 18,630
  • 3
  • 12
  • 22
3

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

2

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
MATCH
  • 100
  • 10