Plugin.BLE (You should reference the NuGet package from your main application project in order to reference the platform-specific implementation)

GTC 121 Reputation points
2021-02-23T19:28:19.567+00:00

Hi all,

I'm hardly able to find a documented BLE library that function with Xamarin so I'll have to try to debug one that sort-of-work, at least it does with Android and IOS (Xaber's BLE.Plugin) but doe not with UWP. Problem is, the following error keep coming up regardless of how and where I ref the nugget packages. Whether I install them into the main application, or the platform-specific one, or both (as per recommendation from MS I've read earlier), it just keeps on throwing the same error no matter what.

Can someone confirm this is valid error? Or am I simply wasting my time trying to make this work? ps. I did scavenged the entire internet for answers however there are no concise enough guidance (for me anyway) that helped me sorting this out. Grateful for any advice.

Exception:
An exception of type 'System.NotImplementedException' occurred in Plugin.BLE.dll but was not handled in user code
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.

Main application project simple test code

namespace BLEtest
{
    public partial class MainPage : ContentPage
    {

        IBluetoothLE ble;
        IAdapter adapter;

        public MainPage()
        {
            InitializeComponent();
            ble = CrossBluetoothLE.Current; <!-- <<<<< It fails here. MvvCrossxxxx package throws the same error, tried that -->
            adapter = CrossBluetoothLE.Current.Adapter;
        }
    }
}
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,944 questions
{count} votes

Accepted answer
  1. Joe Manke 1,091 Reputation points
    2021-02-23T21:46:02.543+00:00

    What version of the package are you using? It looks to me like UWP support is only in the 2.2.0 pre-releases (which were released in 2019 so I wouldn't count on getting a stable version).


3 additional answers

Sort by: Most helpful
  1. Seth Isaacks 46 Reputation points
    2021-08-31T20:13:01.847+00:00

    Has anyone else done this and used the Pre 2.2? I have having an issue with _adapter.DisconnectDeviceAsync()....it never seems to return......it just seems to do nothing if I run it async. If I dont run it async it says the device connected but then if I do a discovery and try to connect, the device says its still connected. Please help....

    0 comments No comments

  2. Sunil Rana 0 Reputation points
    2023-09-26T06:02:50.95+00:00

    We are getting same error in "Plugin.BLE" for iOS

    Details :

    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. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

    We are using this package "

    Plugin.BLE -Version 2.1.3
    

    Please do the needful.

    Regards,

    Sunil Rana


  3. Sharjeel Hussain Khan 0 Reputation points
    2023-11-13T18:50:07.4933333+00:00

    Hi, Is there any update on this?
    We are also getting exactly the same error in "Plugin.BLE" for iOS as Sunil Rana is facing.

    Details :

    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. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

    We are using this package "

    Copy

    Plugin.BLE -Version 2.1.3
    

    When should we expect the fix.

    Regards,

    Sharjeel H Khan

    0 comments No comments