Reachability.swift: How to Add the package within SPM as dependency

Created on 5 Jan 2021  路  3Comments  路  Source: ashleymills/Reachability.swift

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"),

Most helpful comment

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

All 3 comments

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jet-snag picture jet-snag  路  3Comments

samuelbeek picture samuelbeek  路  3Comments

rjt3662 picture rjt3662  路  3Comments

X901 picture X901  路  5Comments

couchdeveloper picture couchdeveloper  路  4Comments