Xcode没有这样的模块
Xcode No such Module
我正在尝试在 Swift 中使用 cocoapod
Alamofire
。但是,当我 Import Alamofire
使用 Xcode 7.2 Alamofire 3.0 和 Swift 2 时,出现错误“No Such Module
” 以下是我采取的步骤
1) 在航站楼 I 运行
$ sudo gem install cocoapods
那时没有错误
2) 我运行
cd ~/Path/To/Folder/Containing/Project
(一次在项目文件夹我运行)
pod init
3) 然后
open -a Xcode Podfile
4) 然后我添加了
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
到 Podfile
5) 然后我运行
pod 'Alamofire', '3.0'
接着是
pod install
我将 $(SRCROOT)
添加到 runpath
和 buildpath
。
我还发现这个答案 说要添加预发布版,但我真的不明白该怎么做,或者这是否是我的问题。也许这很明显,但是我是 Swift 的新手,我不理解。
Alamofire 也应该出现在我的框架或 pods 文件夹中吗?它也不在其中。
files in project
在 pod init
之后,您必须使用新的 <YourProject>.xcworkspace
而不是 <YourProject>.xcodeproj
。
xcworkspace
包含您的 project
和 pod install
之后的 pods
。
我正在尝试在 Swift 中使用 cocoapod
Alamofire
。但是,当我 Import Alamofire
使用 Xcode 7.2 Alamofire 3.0 和 Swift 2 时,出现错误“No Such Module
” 以下是我采取的步骤
1) 在航站楼 I 运行
$ sudo gem install cocoapods
那时没有错误
2) 我运行
cd ~/Path/To/Folder/Containing/Project
(一次在项目文件夹我运行)
pod init
3) 然后
open -a Xcode Podfile
4) 然后我添加了
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
到 Podfile
5) 然后我运行
pod 'Alamofire', '3.0'
接着是
pod install
我将 $(SRCROOT)
添加到 runpath
和 buildpath
。
我还发现这个答案
在 pod init
之后,您必须使用新的 <YourProject>.xcworkspace
而不是 <YourProject>.xcodeproj
。
xcworkspace
包含您的 project
和 pod install
之后的 pods
。