3

I can’t push a new version of my pod to the CocoaPods specs repository.

Running pod trunk push MyPod.podspec results in the following error:

[!] The Pod Specification did not pass validation.
The following validation failed:
- Warnings: Unrecognized `swift_version` key.

Here’s my podspec:

Pod::Spec.new do |spec|

  spec.name = "MyPod"
  spec.version = "0.1.1"
  spec.summary = "[REDACTED]"
  spec.homepage = "[REDACTED]"
  spec.license = "Apache License, version 2"
  spec.author = "[REDACTED]"
  spec.social_media_url = "[REDACTED]"
  spec.module_name = "MyPod"
  spec.swift_version = "5.0"
  spec.platform = :ios, "8.0"
  spec.source = { :git => "https://github.com/[REDACTED].git", :tag => "v#{spec.version}" }
  spec.source_files = "MyPod/**/*.{h,m,swift}"

end

What am I doing wrong?

I first noticed these errors before updating to Swift 5 and Xcode 10.2.

Yakov Manshin
  • 664
  • 9
  • 24

2 Answers2

12

It seems to be a server-side bug. It’s been reported on GitHub.

However, since it’s a warning, not an error (despite it’s in red font color, which is confusing), it can be ignored with the --allow-warnings argument.

Yakov Manshin
  • 664
  • 9
  • 24
0

Summary, to update a pod:

Update the version and the tag in podspec beforehand Commit, push code to git Create new tag with the current code, make sure it's the same tag as the one in podspec

git tag 0.1.1

git push origin 0.1.1 Call pod spec lint to check and pod trunk push to update it on repo master list

pod lib lint YourSDK.podspec

pod trunk push YourSDK.podspec It appears that your podfile is using the tag v0.1.1, however the tag in your repository is 0.1.1 without the v. This would also cause linting to fail.

Abbas Torabi
  • 245
  • 2
  • 13
  • No, it’s not the case: “v” in version number is present both in the podspec and in the repo. Besides, the lint command says the pod passed validation; however, pushing to the trunk fails. – Yakov Manshin Mar 27 '19 at 21:42
  • that's warning. so when you trunk push, allow warnings: pod trunk push MyPod.podspec --allow-warnings hope to help you – Abbas Torabi Mar 27 '19 at 21:54
  • Ah, it’s a warning, indeed. Thank you @AbbasTorabi. I was confused by the red font color, and though it was an error which can’t be ignored by passing the `--allow-warnings` argument. – Yakov Manshin Mar 27 '19 at 22:38