使用swift运行pod安装时出错

我是Swfit和Cocoapods的新手。 我遵循了Cocoapods的指示

以下是我的Podfile:

platform :ios, '8.2' pod 'SwiftyJSON', '~> 2.1' pod 'SwiftSpinner', '~> 0.6' pod 'Alamofire', '~> 1.1' pod 'SuperRecord', '~> 1.2' pod 'Toucan 

当我做荚安装时,我得到了以下错误:

  Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it. 

请帮忙 ?

更新:

以下是我的控制台日志:

 $ pod install Analyzing dependencies Downloading dependencies Installing Alamofire (1.1.4) Installing SuperRecord (1.2) Installing SwiftSpinner (0.6.0) Installing SwiftyJSON (2.1.3) Installing Toucan (0.2.0) [!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it. 

添加“use_frameworks!” 到您的Podfile,因为:

因为Apple不让你build立包含Swift的静态库。 与Objective-C不同的是,苹果并没有将iOS的Swift标准运行时库发布。 这将语言版本从平台版本中分离出来。 当您使用Swift构build应用程序时,您自己负责发送它们。 默认情况下,Xcode使用swift-stdlib-tool来处理复制Swift运行时dylib,但是当试图将仅使用Objective-C的应用程序使用Swift的框架时,这个工具就不够用了。 您的应用程序可执行文件和您发布的框架将全部使用相同的一组dylib,这些dylibembedded到应用程序包的Frameworks子目录中。

首先,这是因为你不能链接到不同版本的标准库。 此外,由于与分配有关的内存大小和networking速度的限制,所以希望仅embedded一次而不是多次。 通过指定use_frameworks!,可以使CocoaPods通过框架而不是静态库集成到您的项目中。 如果不存在,如果您依赖包含Swift源代码的窗格,则无法集成依赖关系。

参考: http : //blog.cocoapods.org/CocoaPods-0.36/

添加“use_frameworks!” 到您的Podfile:

请参阅下面的示例Podfile

目标'MySample' 

荚'AFNetworking','〜> 2.5'

 pod'Net','〜> 0.2'//这是Swift中的示例

 use_frameworks!  // 
结束

就像在Podfile中写的那样,它说取消注释use_frameworks! 是你使用斯威夫特,所以你必须做的不注释这条线,所有的作品就好了

 # Uncomment this line to define a global platform for your project # platform :ios, '8.0' # Uncomment this line if you're using Swift use_frameworks! target 'YourProjectName' do pod 'SwiftyJSON', '~> 2.1' pod 'SwiftSpinner', '~> 0.6' pod 'Alamofire', '~> 1.1' pod 'SuperRecord', '~> 1.2' pod 'Toucan // all other pods goes here end target 'YourProjectName' do end target 'YourProjectName' do end