Swift Package Manager的问题-模块映射应位于“ Include”目录中

时间:2018-11-02 14:36:23

标签: swift swift-package-manager

这是我的Package.swift文件:

let package = Package(
    name: "MyProject",
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/AlwaysRightInstitute/cows.git",
                 from: "1.0.0"),
        .package(url: "https://github.com/NozeIO/MicroExpress.git",
                 .branch("branches/swift-nio-lib"))
    ],
    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: "Demo",
                dependencies: [
                    "cows", "MicroExpress"
            ],
                path: ".")

    ]
)

(我认为)我已经正确初始化了Package,并且已经获取了git repos(使用“ Swift package fetch / resolve”)

现在我正在尝试“快速构建”,但出现以下错误:

'MyTarget' /Users/nimrodshai/Documents/MyProject: error: package has unsupported layout; modulemap '/Users/nimrodshai/Documents/MyProject/Pods/FirebaseCrash/Frameworks/FirebaseCrash.framework/Modules/module.modulemap' should be inside the 'include' directory

任何人都知道如何解决此问题吗?

编辑: 我正在尝试从Pod文件(包括firebase)中卸载所有内容,然后进行构建。这就是我得到的:

'Toky' /Users/nimrodshai/Documents/TOKY-TOY: error: target at '/Users/nimrodshai/Documents/TOKY-TOY' contains mixed language source files; feature not supported

1 个答案:

答案 0 :(得分:0)

尝试使用here中针对publicHeaderPaths的文档作为目标。它说:

  

publicHeadersPath:此属性定义包含C目标的公共头的目录路径。该路径是相对于目标路径的,此属性的默认值包括在内。仅对C系列库目标有效。

您应该可以将其设置为module.modulemap的路径,然后它将很高兴。