I had this error when I was doing a tutorial. I could not solve the problem. So, I deleted the project and made a new simple project to figure-out the issue,but still having the same issue. I am posting relevant code -
package.swift code -
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "dep",
products: [
.library(name: "dep", targets: ["App"]),
],
dependencies: [
// A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
// Swift ORM (queries, models, relations, etc) built on SQLite 3.
.package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0"),
.package(url: "https://github.com/vapor/leaf.git", from: "3.0.0"),
],
targets: [
.target(name: "App", dependencies: ["Leaf","FluentSQLite", "Vapor"]),
.target(name: "Run", dependencies: ["App"]),
.testTarget(name: "AppTests", dependencies: ["App"])
]
)
When I do "vapor build" in terminal and press enter, the terminal shows error - " "/Users/apple/dep: error: package at \'/Users/apple/dep\' is using Swift tools version 3.1.0 which is no longer supported; use 4.0.0 or newer instead\n", output: "")"
I have done the usual stuff like clean-build folder, cleaning derived data etc. Now, what should I do next. If you need any further information, I can post code(s) or screenshot(s).
A somewhat detailed checklist would be …
Command Line Tools:
is pointing to current toolchain version. Xcode 11.3 (11C29) provides Swift 5.1.brew
to the most recent version. (Or, see https://brew.sh/ if the Homebrew package manager is not yet installed.)vapor/tap
tap. Optionally, the tap can be removed and installed again.vapor
viabrew
. Vapor 4 betavapor-beta
has a github issue.Oh, Vapor Toolbox 3.1.12 claims to be "3.1.10". See GitHub issue https://github.com/vapor/toolbox/issues/292.