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

How to Add the package within SPM as dependency #372

Open
ishayan18 opened this issue Jan 5, 2021 · 5 comments
Open

How to Add the package within SPM as dependency #372

ishayan18 opened this issue Jan 5, 2021 · 5 comments

Comments

@ishayan18
Copy link

I am adding Reachability as a dependency in my Swift package. There is no documentation of how would I do that?
There is this error
unknown package 'Reachability' in dependencies of target 'ABC'

My swift.package manifest code

.package(url: "https://github.com/ashleymills/Reachability.swift.git", from: "5.1.0"),
.product(name: "Reachability", package: "Reachability"),
@Artfire
Copy link

Artfire commented Apr 12, 2021

@ShayanPapershift hi,
I've faced with this issue too. Have you solved it?

@Artfire
Copy link

Artfire commented Apr 13, 2021

Was solved:

.package(name: "Reachability", url: "https://github.com/ashleymills/Reachability.swift", .upToNextMajor(from: "5.1.0"))
.product(name: "Reachability", package: "Reachability"),

Just need to be added name: "Reachability" for dependencies

@ishayan18
Copy link
Author

Yes, I solved it by passing the name of the package :)

@FZehana
Copy link

FZehana commented Sep 1, 2021

you add Package name as said @ShayanPapershift, after use it on your dependencies
exemple:
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.4.0")), .package(name: "Reachability", url: "https://github.com/ashleymills/Reachability.swift", .upToNextMajor(from: "5.1.0"))
after
.target( name: "Common", dependencies: ["Alamofire", "Reachability"]),

@clubnika
Copy link

it worked for me
.package(url: "https://github.com/ashleymills/Reachability.swift", .upToNextMajor(from: "5.1.0")),

.product(name: "Reachability", package: "Reachability.swift"),

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

4 participants