I experienced this when I tried the tutorial too. It turned out that my Mac was using the command line tools of an earlier version of Xcode than 8.2.1. Hereās how I ended up fixing it; maybe the same solution will work for you.
Open Xcode, select Xcode > Preferences in the menu, and select the Locations tab. Check that āCommand Line Toolsā is set to Xcode 8.2.1. Then try the swift package command again.
$ swift build
error: /home/mjeragh/Projects/Flag
manifest parse error(s):
/home/mjeragh/Projects/Flag/Package.swift:8:6: error: type āPackage.Dependencyā has no member āPackageā
.Package(url: āā¦/Atlasā)
^~~~~~~
PackageDescription.Package.Dependency:2:24: note: did you mean āpackageā?
public static func package(url: String, from version: PackageDescription.Version) ā PackageDescription.Package.Dependency
^
PackageDescription.Package.Dependency:3:24: note: did you mean āpackageā?
public static func package(url: String, _ requirement: PackageDescription.Package.Dependency.Requirement) ā PackageDescription.Package.Dependency
^
PackageDescription.Package.Dependency:4:24: note: did you mean āpackageā?
public static func package(url: String, _ range: Range<PackageDescription.Version>) ā PackageDescription.Package.Dependency
^
PackageDescription.Package.Dependency:5:24: note: did you mean āpackageā?
public static func package(url: String, _ range: ClosedRange<PackageDescription.Version>) ā PackageDescription.Package.Dependency
^
Thank you for this into to Swift PM, it was helpful. Unfortunately, I canāt puzzle out how to use Swift PM in a typical GUI project in Xcode (8.3.2).
Basically, I have an existing project that is a āCocoa Applicationā. It uses a framework from a GitHub repo. Iād like to use Swift PM to include that framework in my project but I canāt figure out how to organize that sort of project in Xcode using Swift PM.
Also, if you choose to tag your library with anything less than x.x.x (i.e. x.x), it will not work. Package manager expects the version tag in x.x.x format.
This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]