1

I have a private pod, and I am trying to do a pod repo push but its rejecting it because of errors that could only happen in Swift3.0 e.g @noescape is the default and is deprecated. I use --allow-warnings but there are also errors beside this warning, this is just the most obvious Swift3.0 error.

The project itself is in Swift2.3, I have the legacy flag setup in all targets, not to mention I have pushed a new spec just a few days ago and I am unaware what could have changed. The project builds fine in Xcode.

If its relevant, the pod that happens to error out is the Result one, but I am sure it could be any of them.

1
  • I have the same issue and I'm not even using swift for my library............. Commented Nov 8, 2016 at 17:58

1 Answer 1

1

Ok, I am guessing more people might hit this, cause if you call pod spec lint instead of push straight away Cocoapods will point you to the correct answer:

The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: `echo "2.3" > .swift-version`.

Sign up to request clarification or add additional context in comments.

1 Comment

More specifically you have to create a file called .swift-version in which you need to add the version. Run xcrun swift -version in terminal to know your swift version. Then you need to run echo "your.swift.version" > .swift-version. Your issue will be solved :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.