当 pod lib lint 成功时,pod spec lint 失败。 'vendored_frameworks' 模式不匹配任何文件

pod spec lint fails when pod lib lint succeeds. 'vendored_frameworks' pattern did not match any file

我制作了一个框架,我想通过 CocoaPods 分发它。

我不确定我是不是在做傻事。我在基本目录中包含了一个完整的 .framework 文件夹,我希望它成为我的 pod 的源。当我 运行 "pod lib lint" 时,一切似乎都很好但是当我 运行 "pod spec lint" 我得到:

- ERROR | [iOS] The `vendored_frameworks` pattern did not match any file.

我在查看 Whosebug 后尝试添加 preserve_paths,但这似乎无法解决我的问题。通过阅读cocoapods文档,vendored_frameworks是"The paths of the framework bundles that come shipped with the Pod"所以我认为在这里使用它似乎没问题。

这是我的 podspec 文件:

Pod::Spec.new do |s|
  s.name             = "X"
  s.version          = "1.0"
  s.summary          = "Summary"
  s.description      = "Description here"
  s.homepage         = "http://www.valid_homepage.com/"
  s.license          = { :type => "Commercial", :text => "See https://www.license_here" }
  s.author           = { "Author" => "author@website.com" }
  s.source           = { :http => "https://storage.googleapis.com/path/to/file" }
  s.social_media_url = 'https://twitter.com/handle'
  s.platform     = :ios, '7.0'
  s.requires_arc = true
  s.preserve_paths = 'X.framework'
  s.vendored_frameworks = 'X.framework'
  s.frameworks = 'SystemConfiguration'
  s.library  = 'resolv'
end

如有任何见解,我们将不胜感激!谢谢!

.framework 目录具有结构

Framework
  - Headers (Shortcut)
  - LibraryFile (Shortcut)
  - Versions
    - A
      - Headers (Contains .h file)
      - LibraryFile
    - Current (Shortcut to A directory)

想通了。基本上,您分发的任何 zip 的文件夹结构都必须在内部匹配搜索路径。就像你的目录结构是:

.podspec
Frameworks/
    - X.framework

哪里

s.vendored_frameworks = 'Frameworks/X.framework'

那么当你解压 http: 资源时,它应该具有目录结构

Frameworks/
    - X.framework