【发布时间】:2016-09-23 07:15:02
【问题描述】:
我是第一次在项目中使用 pod。我创建了一个新项目并遵循以下流程:
从github下载master,因为终端要求我手动完成
已触发:pod init 方法。此命令在我的 Xcode 项目文件夹中生成 Podfile
然后我在pod文件中添加了一行:
pod 'Alamofire', '2.0.2'
4 .然后我触发了pod install 命令,我在终端窗口中收到以下错误:
Setting up CocoaPods master repo
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
我正在关注本教程: https://www.raywenderlich.com/97014/use-cocoapods-with-swift 请为此问题提出解决方法。 以下是我的 pod 文件:
platform :ios, "8.0"
use_frameworks!
target 'PodsTest' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for PodsTest
pod 'Alamofire', '2.0.2'
target 'PodsTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'PodsTestUITests' do
inherit! :search_paths
# Pods for testing
end
end
【问题讨论】:
-
step-4 应该是 pod install 命令
-
是的,那是错误的,我编辑了我的问题
-
你是如何在 Pod 文件中提到 Alamofire 的 pod 命令的?你能告诉我吗? @V-Xtreme
-
你能告诉我你的xcode版本吗?
-
@EktaMakadiya:8.0 版