sroebert / mqtt-nio

Non-blocking, event-driven Swift client for MQTT (3.1.1 and 5.0).
MIT License
53 stars 13 forks source link

No such module 'MQTTNIO' for watchos application #7

Closed arrow53 closed 2 years ago

arrow53 commented 2 years ago

Per the instructions I have added this package, but I can't seem to import the module. Seems to work fine for an ios application. I must be missing something obvious. Is there anything I can try?

This is the relevant code in my swift code

import MQTTNIO
sroebert commented 2 years ago

I just tested with a watch application and it seems to work fine.

arrow53 commented 2 years ago

@sroebert awesome it works. I have a standalone watchos application as my target.

The error is just No such module MQTTNIO which shows up in the xcode UI.

Let me play with this a bit more. i'm sure i'm doing something stupid. Thanks for confirming it works!

sroebert commented 2 years ago

That happens from time to time with Xcode, in the new beta version you can clear the errors from the menu before building, this might hide it.

arrow53 commented 2 years ago

@sroebert is there a chance you can share your watch application. I basically create a new standalone watchos "Watch App", add the mqtt-nio package with File -> Add Packages... with URL https://github.com/sroebert/mqtt-nio.git (tried main and 2.6.0) and then added the import MQTTNIO in the ContentView swift file at the top. I get the error No such module 'MQTTNIO'

arrow53 commented 2 years ago

in case anyone runs into this the trick is to add the package to the extension and not the base