首页 > 解决方案 > 具有隐藏源的 Pod 文件(仅限框架)

问题描述

你好堆栈溢出用户。我正在尝试创建内部没有源代码的 pod。我阅读了很多教程并尝试遵循它们,但遇到了奇怪的错误。我有这个 podfile.spec

Pod::Spec.new do |s|

s.name         = "sdkTEST"
s.version      = "0.0.1"
s.summary      = "A nice logger tool in Swift."
s.description  = "DESC"

s.homepage     = "https://github.com/test_user"
s.license      = { :type => "MIT", :file => "license" }
s.author       = { "Sergey" => "sergey@gmail.com" }
s.ios.deployment_target = '8.0'
s.ios.vendored_frameworks = 'sdkTEST.framework'
s.source            = { :http => 'https://github.com/LLTemp/test_sic_zip/raw/main/sdkTEST.zip' }
s.exclude_files = "Classes/Exclude"

end

但是当我打电话时

pod lib lint 

我收到这个错误

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

标签: swiftcocoapods

解决方案


执行时

pod lib lint 

pod 实际上不会从s.source url 下载源代码(imo 这是错误)并使用您的本地版本的框架。您可以将 *.framework 文件放在库路径中,错误就会消失。

对于那些有兴趣在没有来源的情况下发布 pod 的人来说还有一件事。要使用实际的 pod,Podfile 应该如下所示

target 'OpenSSLTest' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'OpenSSL-Universal'
  pod 'test_sic', :podspec => 'https://raw.githubusercontent.com/LLTemp/test_sic/1.0.12/test_sic.podspec'  
end

注意使用:podspec而不是:git:http


推荐阅读