【问题标题】:Cocoapods: ERROR | [iOS] unknown: Encountered an unknown error (Pod::DSLError) during validationCocoapods:错误 | [iOS] 未知:验证过程中遇到未知错误(Pod::DSLError)
【发布时间】:2021-02-19 17:16:02
【问题描述】:

我在 linting spec 或推送它的 pod 时突然开始收到以下错误:

错误 | [iOS] 未知:验证过程中遇到未知错误(Pod::DSLError)。

最近对规范所做的唯一更改是版本提升(自上次正常运行以来)。这是完整的规范:

Pod::Spec.new do |s|

    s.version      = '2.0.0-alpha20'
    s.name         = 'RollbarCommon'
    s.summary      = 'Application/client side SDK for accessing the Rollbar API Server.'
    s.description  = <<-DESC
                      Find, fix, and resolve errors with Rollbar.
                      Easily send error data using Rollbar API.
                      Analyze, de-dupe, send alerts, and prepare the data for further analysis.
                      Search, sort, and prioritize via the Rollbar dashboard.
                   DESC
    s.homepage     = "https://rollbar.com"
    s.license      = { :type => "MIT", :file => "LICENSE" }
    s.documentation_url = "https://docs.rollbar.com/docs/ios"
    s.authors            = { "Andrey Kornich (Wide Spectrum Computing LLC)" => "akornich@gmail.com",
                              "Rollbar" => "support@rollbar.com" }
    s.social_media_url   = "http://twitter.com/rollbar"
    s.source             = { :git => "https://github.com/rollbar/rollbar-ios.git",
                              :tag => "v#{s.version}",
                              :submodules => true }
    s.resource = 'rollbar-logo.png'

    #  When using multiple platforms:
    s.ios.deployment_target = '9.0'
    s.osx.deployment_target = '10.10'
    s.tvos.deployment_target = '11.0'
    s.watchos.deployment_target = '4.0'

    s.source_files  = "#{s.name}/Sources/#{s.name}/**/*.{h,m}"
    s.public_header_files = "#{s.name}/Sources/#{s.name}/include/*.h"
    s.module_map = "#{s.name}/Sources/#{s.name}/include/module.modulemap"

    s.framework = "Foundation"
    
    s.requires_arc = true

end

知道什么地方出了问题吗?

【问题讨论】:

    标签: cocoapods


    【解决方案1】:

    我刚刚找到了这个错误的原因。在我的代码库中,我定义了多个 .pdspec 文件(每个 SDK 模块一个)。一些 podspecs 是完整的,并且工作了很长时间,没有任何变化(除了版本颠簸)。最近引入了其他 podspecs,并且正在进行中。

    当我尝试发布或 lint 完整的 podspec 时,发生了相关错误。然而,看起来(在深入研究错误日志中提到的 Ruby 脚本之后)Cocoapods 在特定 podspec 的 lint 和发布期间运行验证步骤。验证步骤的一部分会遍历同一目录中的所有 .podspec 文件(甚至可能是目录树 - ? )。因此,在我的情况下,它发现了不完整的 podspecs 并尝试验证它们(为什么?)并导致失败并出现错误。

    该错误对于解决问题以及报告的日志跟踪完全没有帮助。找出一些有用提示的唯一方法是查看日志中提到的 Ruby 脚本行周围的代码块,并尝试对可能出现的问题进行逆向工程。

    我只是想分享我的故事,并可能防止其他人遇到类似的错误(Google 搜索显示了很多这样的错误)并在尝试解决问题时感到沮丧。

    【讨论】:

    • 我浪费了一整天...谢谢你的回答
    猜你喜欢
    • 1970-01-01
    • 2017-08-30
    • 1970-01-01
    • 2013-04-05
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-11-17
    相关资源
    最近更新 更多