我正在开发我的应用程序,但在添加包以便导入它时,我总是收到此错误。
error: type 'Package.Dependency' has no member 'Package'
这是我的 Package.swift 代码:
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "xHelp",
dependencies: [
.Package(url: "https://github.com/onevcat/Hedwig.git",
majorVersion: 1)
],
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: "xHelp",
dependencies: ["Hedwig"]),
.testTarget(
name: "xHelpTests",
dependencies: ["xHelp"]),
]
)
我试过了this所以发布,但它没有用。我应该在这里做什么?
最佳答案
你应该这样写。
.package(url: "https://github.com/onevcat/Hedwig.git", from: "1.0.0"),
关于ios - Package.Dependency 没有成员 Package,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49502975/