问题
Every time I run pod lib lint file.podspec I receive this storage warning and I can't figure out how to fix it
回答1:
The .swift-version
is a file that serves as a hint for cocoapods to know which version of Swift your pod target, for the given branch/commit/tag.
The content of the file should exclusively contain the Swift version your pod targets, so 4.2
for example if you target Swift 4.2. You can easily create such a file by navigating to the podspec's folder using the Terminal app, and then write:
echo '4.2' > .swift-version
(replace 4.2
with the Swift version you target)
You can find an example of such a file on Sourcery's repository: https://github.com/krzysztofzablocki/Sourcery/blob/master/.swift-version
回答2:
You won't receive this warning if you are using CocoaPods 1.7.0.beta.1 or newer because the .swift-version file was deprecated, see this link for more details. Use the swift_versions attribute to specify the Swift version:
s.swift_versions = ['5.0']
来源:https://stackoverflow.com/questions/47887487/pod-lib-lint-error-warn-swift-version