我正在尝试为以下位置创建Podspec:https://github.com/sincerely/shiplib-ios-framework

Pod Lint通过并且文件已添加到项目中,但是它没有链接二进制“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' => '[email protected]' }
  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

最佳答案

不会为框架复制标题,并且不应将其指定为源文件。如果您只是想将框架添加为vendored_framework。这是CP 0.23.0中的新功能。

Documentation

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

编辑:
.framework中删除有关s.source_files的所有内容。源文件就是文件,不是框架。

08-05 23:35