Skip to content
Advertisement

Swift – Can’t import packages

I have been trying out Swift on Ubuntu 20.10 and am having trouble importing packages. Swift is installed properly. I am always getting error: no such module, no matter which package I try.
Here is my Package.swift (Embassy as an example):

JavaScript

main.swift(under Sources/test)

JavaScript

Advertisement

Answer

In your Package.swift file you are declaring Embassy as a dependency, but you are not referencing that dependency in any of your targets. In the example you provided, you can alter your package like this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement