Closed tjolsen-vn closed 1 year ago
When you add PusherSwift as an SPM package, did you use the XCode Menu's File -> Add Packages ...
(or right click ->Add Packages
on the left sidebar), or are you adding it in your own Package.swift?
SPM should resolve PusherSwift's dependencies automatically. That you manually added NWWebsocket sounds like something gone wrong here.
When you add PusherSwift as an SPM package, did you use the XCode Menu's
File -> Add Packages ...
(or right click ->Add Packages
on the left sidebar), or are you adding it in your own Package.swift?SPM should resolve PusherSwift's dependencies automatically. That you manually added NWWebsocket sounds like something gone wrong here.
Yes, I used Xcode's menu (File -> Add Packages ...
) and added https://github.com/pusher/pusher-websocket-swift.git
. But, when I did that, I got a bunch of errors about not finding symbols for NWWebSocket
referenced from Pusher. So then I also added NWWebSocket (also through Xcode's menu), and then ended up with the errors above.
At any rate, I was able to successfully integrate with your work around in another issue thread. But I wasn't able to use SPM. Which at this point is fine on my end. I just really didn't want to integrate Carthage or CocoaPods into this legacy code base. So the manual download was great for me.
If you're able to use my workaround then I will close this Github issue for now.
Steps to reproduce
I'm having trouble importing Pusher into a (mostly) Obj-C code base. I plan on doing this integration in Swift, however. But, when I added Pusher to the target via SPM (https://github.com/pusher/pusher-websocket-swift.git), I got a bunch of "Undefined symbols for architecture arm64" errors for
NWWebSocket
stuff. So, then I tried also adding NWWebSocket via SPM (https://github.com/pusher/NWWebSocket.git).It seems it got me past the previous errors, but now I'm seeing errors like:
I'm sure this is something on my end, but am I missing something? I don't see any other dependencies in the README.
If I build with Pusher removed from the target, it builds fine.
Expected behavior
Just trying to get the target to build with Pusher added.
Actual behavior
I get build errors when adding Pusher.
Any improvements you suggest
Just looking for some help. ...