I am using Xcode 8.2.1 and CocoaPods v1.1.1 and my code is Swift 3
My issue is with publishing new version of my pod or updating existing version, which fails on pod spec lint.
I've created a PlaybuzzSDK pod and I would like to update it's code. I commit and push the new code through GitHub client, but the changes are not reflected on the pod class, only on the Example project.
I've created new tag and tried to push it, but didn't pass validation:
git tag 0.1.1 (successful)
git push origin 0.1.1 (successful)
pod spec lint PlaybuzzSDK.podspec (unsuccessful with error below)
pod trunk push PlaybuzzSDK.podspec (unsuccessful with error below)
-> PlaybuzzSDK (0.1.1) - ERROR | [iOS] unknown: Encountered an unknown error ([!] /usr/bin/git clone https://github.com/LudaFuxPlaybuzz/playbuzz-ios-sdk.git /var/folders/h0/knhpn8z16n3cz6tkny5rmtn00000gn/T/d20161228-47834-nli8c4 --template= --single-branch --depth 1 --branch v0.1.1
Cloning into '/var/folders/h0/knhpn8z16n3cz6tkny5rmtn00000gn/T/d20161228-47834-nli8c4'... warning: Could not find remote branch v0.1.0 to clone. fatal: Remote branch v0.1.0 not found in upstream origin ) during validation.
[!] The spec did not pass validation, due to 1 error. [!] 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.
Additional things I've tried:
rm -rf ~/Library/Caches/Cocoapods
rm -rf ~/.cocoapods/repos
But I get this error every time.
I expected that from now on, if somebody adds
pod 'PlaybuzzSDK'
and will update their pods, they'll get the new version
New version means that reloadItem will have the following signature:
public func reloadItem(_ itemAlias:String,
companyDomain: String,
showItemInfo:Bool)
I can't get through the pod lint. And when I update pod from example project, the function reloadItem gets back to
public func reloadItem(_ userID: String,
itemAlias:String,
showRecommendations: Bool,
showShareButton: Bool,
showFacebookComments: Bool,
showItemInfo: Bool,
companyDomain: String)
https://github.com/LudaFuxPlaybuzz/playbuzz-ios-sdk
In your podfile, write : pod 'podname', 'desired version'. Run pod update or pod install (as applicable) to get the pods as mentioned in above step. Compile the code with your desired pod version.
Summary, to update a pod:
podspec
beforehandCreate 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.
You need to add a file called .swift-version
to the top level of your repository in order to have your users projects configured correctly when the pod is installed.
In the top level of your project, run this command:
echo "3.0" > .swift-version
Then commit that and update your tag to that commit.
It also 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With