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

3

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.

Dyestuff answered 2/10, 2019 at 4:35 Comment(12)
Have you install nuget package to Android project?Nationalize
@PhatHuynh That packages are also showing on the android project.Dyestuff
This link could be helpful: Current is not implementedNationalize
@PhatHuynh nothing helps meDyestuff
What is the version of your xamarin.forms in share project and specific platforms?Danyel
Make sure that you update the version of Xamarin.Forms in Android project to 4.2.x .Danyel
@LucasZhang-MSFT Yes it is 4.2.0.815419Dyestuff
Share you sample and I will check it .Danyel
@LucasZhang-MSFT drive.google.com/open?id=1IVFwV0usob-eLfFmjPvPXXfpBTKGnc2gDyestuff
@LucasZhang-MSFT Fixed, the problem is with the target framework of android project. I set the compile using android version to Android 9.0 and problem solved.Dyestuff
@LucasZhang-MSFT Can you please post it as your answer, I will accept it.Dyestuff
Also can you please check why the following video link is not playing on the app. public string videourl = "player.vimeo.com/video/361089481"; I have added this link on the app.Dyestuff
D
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).

Danyel answered 2/10, 2019 at 7:41 Comment(2)
Is there any way of playing video without the video format?Dyestuff
You can use a WebView and play the video in it.But it will be a little complex .Danyel
C
4

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

Compelling answered 26/5, 2020 at 19:12 Comment(1)
I had a similar issue (same error message, different packages). Updating my compile version to Android 13 solved the problem for me. 4 years later: thank you!Schnabel
R
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
Removable answered 26/3, 2020 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.