Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin Mac - PlatformNotSupported exception #376

Open
Archonic944 opened this issue Dec 12, 2023 · 3 comments
Open

Xamarin Mac - PlatformNotSupported exception #376

Archonic944 opened this issue Dec 12, 2023 · 3 comments
Labels

Comments

@Archonic944
Copy link

Archonic944 commented Dec 12, 2023

When trying to create a new BluetoothClient, I get this exception:
System.PlatformNotSupportedException: Operation is not supported on this platform. at InTheHand.Net.Sockets.BluetoothClient..ctor () [0x0000e] in <94af572180da485e94ec3b79bdd26b9c>:0 at BrainBluetoothDetection.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00001] in /Users/gabriel/Projects/BrainBluetoothDetection/BrainBluetoothDetection/AppDelegate.cs:16 at at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain(int,intptr) at AppKit.NSApplication.Main (System.String[] args) [0x00048] in /Library/Frameworks/Xamarin.Mac.framework/Versions/9.3.0.23/src/Xamarin.Mac/AppKit/NSApplication.cs:119 at BrainBluetoothDetection.MainClass.Main (System.String[] args) [0x00007] in /Users/gabriel/Projects/BrainBluetoothDetection/BrainBluetoothDetection/Main.cs:10
I am on MacOS Ventura 13.0.1. I have the NuGet packages IOBluetooth, .Net.Bluetooth, .IOBluetoothUI, and Bluetooth.Permissions installed. I'm using Visual Studio for Mac. You can have a look at my project here:
Archive.zip

Unfortunately, I have had a ton of trouble with all this, and as a result, there may be things like duplicate SDKS on my computer. I specifically remember installing Xamarin multiple times, had to reinstall XCode quite a few times, as well as Android Studio. I also tried initially with JetBrains rider but it just didn't work (frameworks weren't found).

@peterfoot
Copy link
Member

Bluetooth Classic is not currently implemented for macOS. The underlying IOBluetooth binding library is available so you can use the low level API at a push.

@Archonic944
Copy link
Author

Ah, that's unfortunate. I made a PRQ to clarify that in the README, assuming that it's available on Linux too.

@Archonic944
Copy link
Author

Reopening just to ask: do you know of any good Bluetooth libraries (C# or other lang) for making a bluetooth application from Mac? I found jSerialComm but I'm not sure if that's ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants