PerNil
PerNil

Reputation: 187

Twilio: No such module `Alarmofire` when trying to get started

Im trying to learn the ropes of Twilio. The goal is to send text messages from my app. Im following this getting started guide

At the last step is to run this command in terminal: (yes I have changed SwiftSMSwith my own project name)

swift build && ./.build/debug/SwiftSMS    

This command results in the following:

MyMac:MyProject MyName$ swift build && ./.build/debug/myProject Compile Swift Module 'myProject' (1 sources) /Volumes/myProject/myProject/Sources/myProject/main.swift:2:8: error: no such module 'Alamofire'
import Alamofire

^ error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Volumes/myProject/myProject/.build/debug.yaml main output:

I have not done any config with Twilio in Xcode yet. As far as I can understand from the guide should this send a message without doing anything in Xcode?

EDIT*:
Package.swift:

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

 import PackageDescription

let package = Package(
    name: "myProject",
    dependencies: [
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.0")
    ],
    targets: [
        .target(
            name: "myProject",
            dependencies: ["Alamofire"]),
        .testTarget(
            name: "myProjectTests",
            dependencies: ["Alamofire"]),
        ]
)

Upvotes: 0

Views: 432

Answers (1)

Gereon
Gereon

Reputation: 17864

Use this as your Package.swift - you can't simply say "Alamofire" and expect SPM to magically know where to get the sources from.

import PackageDescription

let package = Package(
    name: "myProject",
    dependencies: [
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.0")
    ],
    targets: [
        .target(
            name: "myProject",
            dependencies: ["Alamofire"]),
        .testTarget(
            name: "myProject Tests",
            dependencies: ["Alamofire"]),
        ]
)

Upvotes: 2

Related Questions