Podspec在podfile pod导入时失败

时间:2015-12-05 22:35:21

标签: ios xcode swift cocoapods podspec

我为我的项目创建了一个podspec文件,该文件本身有一个podfile

Podfile看起来像这样:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'FLAnimatedImage', '~> 1.0'

Podspec文件也是标准设置:

Pod::Spec.new do |s|
  s.name         = "ConversationVC"
  s.version      = "1.0.1"
  s.summary      = "ConversationViewController, for messaging"
  s.homepage     = "[HOMEPAGE URL]"
  s.author       = { "Andrew Hart" => "[EMAIL ADDRESS]" }
  s.license      = { :type => 'MIT', :file => 'LICENSE'  }
  s.source       = { :git => "[GIT URL]", :tag => s.version.to_s }
  s.platform     = :ios, '9.0'
  s.requires_arc = true
  s.source_files  = 'Source/**/*.swift'
  s.frameworks   = 'UIKit'
  s.ios.deployment_target = '9.0'
end

我正在使用pod lib lint命令确保它通过Podspec测试,我收到此错误:

  

错误| xcodebuild:/Users/Andrew/Code/ConversationVC/Source/View/ConversationImageCell.swift:10:8:错误:没有这样的模块'FLAnimatedImage'

该文件确实有import FLAnimatedImage行,引用了我的一个pod,就像我项目中的许多其他文件一样。

我尝试在另一个项目中使用pod,给出了git url,并且它成功了,但是当我在Xcode中构建工作区时,它给了我与FLAnimatedImage缺失框架相同的错误。

我想知道我应该如何处理这种情况?

1 个答案:

答案 0 :(得分:4)

您也应该在podspec文件中声明您的依赖项,如下所示:

s.dependecy "FLAnimatedImage", "~> 1.0"
相关问题