CocoaPods/CocoaPods · error · Informative

The `#{podspec}` specification does not validate. #{e.messa

Error message

The `#{podspec}` specification does not validate.

#{e.message}

What it means

During `pod repo push`, validate_podspec_files runs a full Validator per podspec with your flags. Any exception raised inside validator.validate (unreachable :git/:http source, malformed podspec, crashed check) is rescued and wrapped as Informative with the original exception text appended after the headline. This signals validation crashed outright — distinct from a clean failed-check result, which hits the separate `unless validator.validated?` raise without appended detail.

Source

Thrown at lib/cocoapods/command/repo/push.rb:155

        # Performs a full lint against the podspecs.
        #
        def validate_podspec_files
          UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
          podspec_files.each do |podspec|
            validator = Validator.new(podspec, @source_urls)
            validator.allow_warnings = @allow_warnings
            validator.use_frameworks = @use_frameworks
            validator.use_modular_headers = @use_modular_headers
            validator.ignore_public_only_results = @private
            validator.swift_version = @swift_version
            validator.skip_import_validation = @skip_import_validation
            validator.skip_tests = @skip_tests
            validator.validation_dir = @validation_dir
            begin
              validator.validate
            rescue => e
              raise Informative, "The `#{podspec}` specification does not validate." \
                                 "\n\n#{e.message}"
            end
            raise Informative, "The `#{podspec}` specification does not validate." unless validator.validated?
          end
        end

        # Checks that the repo is clean.
        #
        # @raise  If the repo is not clean.
        #
        # @todo   Add specs for staged and unstaged files.
        #
        # @todo   Gracefully handle the case where source is not under git
        #         source control.
        #
        # @return [void]
        #
        def check_repo_status

View on GitHub (pinned to b80e113e28)

Solutions

  1. Read the text after the blank line — it is the underlying exception and the real cause
  2. Reproduce standalone with `pod spec lint Name.podspec` using the same flags for a cleaner trace
  3. Fix the root cause (push the git tag, correct s.source, repair the toolchain) and re-push

Example fix

# before (MyPod.podspec)
s.source = { :git => 'https://github.com/org/MyPod.git', :tag => 'v1.0.0' }  # tag not pushed

# after
git tag v1.0.0 && git push origin v1.0.0
pod repo push my-specs MyPod.podspec
Defensive patterns

Strategy: try-catch

Validate before calling

# pre-lint the exact spec with the same flags before pushing
spec = Dir['*.podspec{,.json}'].first or abort 'no podspec'
system('pod spec lint', spec, '--sources', ENV['SPEC_REPO_URL'] || 'trunk') or abort("#{spec} failed lint - fix before repo push")
system('pod repo push', ENV['SPEC_REPO_NAME'], spec) or exit $?.exitstatus

Try / catch

begin
  Pod::Command.run(['repo', 'push', repo, spec])
rescue Pod::Informative => e
  if e.message =~ /does not validate\.\s*\n\s*\n(.*)\z/m
    warn "underlying cause: #{$1}"  # surface the wrapped exception text
  end
  exit 1
end

Prevention

When it happens

Trigger: Pushing a podspec whose s.source git tag has not been pushed yet, a repo URL typo, malformed .podspec.json, or a broken local toolchain that makes the lint app project raise rather than fail checks.

Common situations: Tag forgotten before push; CI machine with broken Xcode state; JSON syntax error introduced by hand-editing the podspec.

Related errors


AI-assisted analysis of CocoaPods/CocoaPods@b80e113e28 (2026-08-21). Data as JSON: /api/errors/0e0dba97c24e6bb0. Report an issue: GitHub.