添加PostgresStORM包时,swift完美项目构建失败

时间:2017-02-21 14:21:28

标签: swift xcode postgresql perfect

即时通讯使用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)
    ]
)

here解释了如何将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 errors

我该如何解决这个问题?我在网上找不到任何东西

我尝试过但没有用过: 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并且不得不把它放回去。

1 个答案:

答案 0 :(得分:1)

I had excaclty the same problem when I was using Docker and created some server side stuff. I created by commandline in Docker the package and build it.

swift package init --type executable
swift build

after it's IMPORTANT to go on your terminal outside of Docker to your project directory and create the xcode file.

swift package generate-xcodeproj

enjoy :-)