Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swift perfect project build get failed when adding PostgresStORM package

im using Xcode 8.2.1 and also my swift version is 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)

and here is my package.swift contents

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 explains how to add Postgres stORM to your project. when i add PostgresStrom to my package and build i get the following build errors:

/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

how can i fix this? i couldn't find anything on web

What I've tried and didn't work: 1- clear project (command +shift + k) and (command + option + shift + k) 2- delete diverted data 3- create complete new project 4- deleted /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/module.modulemap which ruined my xcode and had to put it back.

like image 918
Mohammadalijf Avatar asked Nov 09 '22 01:11

Mohammadalijf


1 Answers

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 :-)

like image 193
Johannes Knust Avatar answered Nov 15 '22 07:11

Johannes Knust