Getting 'No Such Module 'PromiseKit'' In Ubuntu 22.04

34 Views Asked by At

I'm very new to Swift and I might be making a really simple mistake. I am trying to get my environment set up for a project and I'm getting an error importing PromiseKit into the program.

I've searched up a lot of different stackoverflow posts and tried them, but they were unsuccessful, and I think my operating system might make things different even though its supported.

Here is my Package.swift:

// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "MyPackage",
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "MyPackage",
            targets: ["MyPackage", "MySubPackage"]),
    ],
    dependencies: [
    
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .target(name: "MyPackage",
                dependencies: [
                ],
                path: "Sources/MyPackage"),
        .target(name: "MySubPackage",
                dependencies: [
                   .product(name: "PromiseKit", package: "PromiseKit")
                ],
                path: "Sources/MyOtherPackage"),   
        .testTarget(
            name: "MyPackageTests",
            dependencies: ["MyPackage"]),
    ]
)

package.dependencies.append(
     .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.8.0")
)

I don't know if this matters, but here is my project structure too:

|--- .build
|--- .vscode
|--- Sources
|      |--- MyPackage
|             |--- MyPackage.swift
|      |--- MySubPackage
|             |--- MySubPackage.swift
|--- Tests
|--- .gitignore
|--- Package.resolved
|--- Package.swift

Note: MyPackage and MySubPackage are aliases for my package name

0

There are 0 best solutions below