Twilio:尝试开始时没有这样的模块“Alarmofire" [英] Twilio: No such module `Alarmofire` when trying to get started
问题描述
我正在尝试学习 Twilio 的诀窍.目标是从我的应用程序发送短信.我正在关注 本入门指南
Im trying to learn the ropes of Twilio. The goal is to send text messages from my app. Im following this getting started guide
最后一步是在终端中运行这个命令:(是的,我已经用我自己的项目名称更改了SwiftSMS
)
At the last step is to run this command in terminal: (yes I have changed SwiftSMS
with my own project name)
swift build && ./.build/debug/SwiftSMS
此命令的结果如下:
MyMac:MyProject MyName$ 快速构建 &&./.build/debug/myProject 编译Swift 模块myProject"(1 个来源)/Volumes/myProject/myProject/Sources/myProject/main.swift:2:8: 错误:没有这样的模块Alamofire"
进口阿拉莫火
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
^ 错误:已终止(1):/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool-f/Volumes/myProject/myProject/.build/debug.yaml 主输出:
^ 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:
我还没有在 Xcode 中对 Twilio 进行任何配置.据我从指南中了解到,这是否应该在 Xcode 中不执行任何操作的情况下发送消息?
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?
编辑*:
包.swift:
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"]),
]
)
推荐答案
将此用作您的 Package.swift
- 您不能简单地说Alamofire"并期望 SPM 神奇地知道从哪里获取来源.
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"]),
]
)
这篇关于Twilio:尝试开始时没有这样的模块“Alarmofire"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!