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

Swift Package Manager submodule issue #1077

Open
Arneoldenhave opened this issue Oct 6, 2020 · 2 comments
Open

Swift Package Manager submodule issue #1077

Arneoldenhave opened this issue Oct 6, 2020 · 2 comments

Comments

@Arneoldenhave
Copy link

Arneoldenhave commented Oct 6, 2020

What did you do?

I've made a swift package that has a dependency on SwiftyJSON.
I've included it as a SPM package as per the documentation on github.
dependencies: [
.package(url: "https://github.com/jernejstrasner/CCommonCrypto.git", .branch("master")),
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "4.0.0")
}

What did you expect to happen?

SwifyJSON should be importable as a module in my package

What actually happened instead?

Hower, I keep getting: "No such module 'SwiftyJSON'".
Other packages work fine

Environment

List the software versions you're using:

  • SwiftyJSON: 4.3.0
  • Xcode Version: 12.0
  • Swift Version: 5.3

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Swift Package Manager - Swift 5.3.0)
@rayastar
Copy link

same problem. Anybody know how to resolve bag?

@DominikButz
Copy link

Hi, I had the same problem with another sub-dependency. You need to add the name of the sub-module (not the url) also in targets.
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "PackageName",
dependencies: ["NameOfSubDependency"]),
...
]

Afterwards, I was able to import the sub-module into the module. You might have to clean and build again. What also helped was to remove the module in the target under General / "Frameworks,libraries And Embeddedcontent" and then add it again after typing the dependency in the package file.

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

No branches or pull requests

3 participants