由于未声明的类型错误,无法pod pod lint

时间:2015-06-08 15:18:03

标签: ios swift cocoapods nsfetchedresultscontroller uiwindow

我试图创建一个pod,依靠其他pod进行编译(JSQSystemSoundPlayerJSQMessagesViewControllerXMPPFramework

我必须补充一点,源代码是用Swift (1.2)写在Xcode 6.3.2上的,我使用cocoapod 0.34.4XMPPFramework无法编译最新版本(循环导入))

当我使用以下命令pod trunk push podname.podspec --verbose时,我收到这样的错误: podname已更改

error: use of undeclared type 'NSFetchedResultsControllerDelegate'
error: use of undeclared type 'UIWindow'
[!] The podspec does not validate.

这是我的pod: podname已更改

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'target_example', :exclusive => true do
  pod "podname", :path => "../"
    pod "JSQSystemSoundPlayer"
    pod "JSQMessagesViewController"
    pod "XMPPFramework"
    pod "FMDB"
end

这是我的podSpec: podname已更改

#
# Be sure to run `pod lib lint pod.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = "podname"
  s.version          = "0.1.0"
  s.summary          = "Summary"
  s.description      = <<-DESC
                       desc
                       DESC
  s.homepage         = "https://github.com/company/project"
  s.license          = 'MIT'
  s.author           = { "company" => "mail" }
  s.source           = { :git => "https://github.com/company/project.git", :tag => "master" }

  s.platform     = :ios, '8.0'
  s.requires_arc = true

  s.source_files = 'Pod/Classes/**/*'
  s.frameworks = 'Foundation', 'CoreData', 'UIKit'
  s.dependency 'FMDB', '~> 1.0'
  s.dependency 'JSQMessagesViewController', '~> 6.1.3'
  s.dependency 'JSQSystemSoundPlayer', '~> 2.0.0'
  s.dependency 'XMPPFramework'

end

感谢所有帮助

1 个答案:

答案 0 :(得分:0)

这些错误与libxml中任何位置Podspec的缺失有关,我通过在Podspec文件中添加以下内容来修复错误:

s.libraries = 'xml2'
s.xcconfig = {
'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2'
}