Podspec链接二进制库

时间:2013-08-13 21:10:35

标签: ios cocoapods

我正在尝试为https://github.com/sincerely/shiplib-ios-framework

创建一个Podspec

Pod Lint传递&amp;文件正在添加到项目中,但它不链接二进制“Sincerely”文件。通过以下方式导入时,示例项目构建因缺少文件而失败:<Sincerely/filename.h>

 Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  ...
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  } 
  s.library = 'Sincerely'
  s.source_files = 'Sincerely.framework','Sincerely.framework/Headers/*.h'
  s.resources = 'Sincerely.framework/Resources/*.{png,nib}'
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.xcconfig  =   { 'LIBRARY_SEARCH_PATHS' =>  '$(PODS_ROOT)/ShipLib/' }
end

修改

Pod::Spec.new do |s|
  s.name  = 'ShipLib'
  s.version = '1.4'
  s.platform = :ios
  s.summary = 'Allow users to send printed photos from your app.'
  s.author = { 'Sincerely' => 'dev@sincerely.com' }
  s.homepage = 'https://github.com/sincerely/shiplib-ios-framework'
  s.license = { :file => 'LICENSE', :type => 'Commercial' }
  s.source = {
    :git => 'https://github.com/sincerely/shiplib-ios-framework.git',
    :tag => 's.version.to_s'
  }
  s.frameworks = 'AddressBook', 'AddressBookUI', 'SystemConfiguration', 'CoreTelephony'
  s.ios.vendored_frameworks = 'Sincerely.framework'
end

2 个答案:

答案 0 :(得分:13)

不会为框架复制标头,也不应将其指定为源文件。如果您要做的只是将框架添加为vendored_framework。这是CP 0.23.0中的新内容。

来自Documentation

  spec.ios.vendored_frameworks = 'Frameworks/MyFramework.framework'

修改
.framework删除有关s.source_files的所有内容。源文件只是文件,而不是框架。

答案 1 :(得分:0)

我猜你的项目可能缺乏真诚的图书馆在Sincerely.framework。如果您使用sourcetree来管理项目,那么导致问题的是源树的错误。 Sourcetree没有检测到Sincerely库。