5

我使用 Xcode 8.2.1,而且我的 swift 版本是3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)

这是我的 package.swift 内容

import PackageDescription

let package = Package(
    name: "MyAwesomeProject",
    dependencies: [
        .Package(
            url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git",
            majorVersion: 2, minor: 0
        ),
        .Package(url: "https://github.com/PerfectlySoft/Perfect-PostgreSQL.git", majorVersion: 2, minor: 0),
        .Package(url: "https://github.com/SwiftORM/Postgres-StORM.git", majorVersion: 1, minor: 0)
    ]
)

这里解释了如何将 Postgres stORM 添加到您的项目中。当我将 PostgresStrom 添加到我的包并构建时,我收到以下构建错误:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/module.modulemap:1:8: error: redefinition of module 'AppleTextureEncoder'
module AppleTextureEncoder [system] [extern_c]

xcode 错误

我怎样才能解决这个问题?我在网上找不到任何东西

我尝试过但没有成功:1-清除项目(命令+shift+k)和(命令+选项+shift+k)2-删除转移的数据3-创建完整的新项目4-删除/Applications/Xcode .app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/module.modulemap 这毁了我的xcode,不得不把它放回去。

4

1 回答 1

1

当我使用 Docker 并创建一些服务器端的东西时,我遇到了同样的问题。我在 Docker 中通过命令行创建了包并构建它。

swift package init --type executable
swift build

重要的是在 Docker 之外的终端上进入项目目录并创建 xcode 文件。

swift package generate-xcodeproj

请享用 :-)

于 2017-06-15T09:46:05.237 回答