Cocoapods: How do I update a podspec?

Created on 3 Nov 2014  路  11Comments  路  Source: CocoaPods/CocoaPods

I've discovered a serious problem in the AdMob podspec, and I am attempting to push an update to it to fix said problem. I am the "owner" of this podspec (i.e. it shows up when I do a pod trunk me.)

According to the guide, in the "How do I update an existing Pod?" section, the procedure for updating an existing pod should be as follows:

  1. Create your Podspec as described described above.
  2. Run pod spec lint to check for errors.
  3. Submit your Podspec to Trunk with pod trunk push NAME.podspec

I have done all of the above, the Podfile passes lint perfectly, however when attempting to pod trunk push it, I am getting the error "Unable to accept duplicate entry for: Google-AdMob-Ads-SDK (6.12.0)"

What am I doing wrong?

All 11 comments

You cannot update an already existing version with pod trunk, you can only release a new one.

Fair enough. Then is the procedure for updating an already-existing pod the same as it always was (fix it in my own fork of the Cocoapods repo and submit a pull request)? If so then the documentation link I referenced above should probably be changed, since it states that pod trunk push is how this is done.

Yes, if you have a serious issue with an existing version, you can submit a PR. The guide's update section is rather about adding a new version, but I agree that it can be a little bit confusing.

s.version = "0.1.0-beta"
Change the version and push again!!!

Hi, I have the same problem too. Since my user case is that I want to make sure the version shown on Cocoapods is the same as the project version I have published on website. If I do find some serious bugs or License problem in the current version, is it possible for me to update it with the same version? Or can I just delete the current version and update it again? I cannot find an option to delete the published Cocoapods pod spec in the command lists. Thanks!

The commands are in the 1.0 betas

Thanks orta! I do find the delete command.

Hi @orta, the delete command in pod trunk says:

Once deleted, this version can never be pushed again.

Does that mean it is not a way to fix a broken podspec without changing the version?

@oliverou , did you end up trying it?

@jcanizales Yes, you cannot update the same version once you push to cocoapods trunk, you can only update your pods in next version. So be careful to update your pods.

I encountered this issue when I pod trunk push at the second time as the first run failed when running pod repo update, it just pushes the podspec to cocoapods remote server successfully at the first time. Confirmed it just now. FYI.

@xingheng, I tried twice. it did not work and why it should in second time. I guess there should have been a way to update existing podspec file (scope for improvement).
If not then, I guess, we have to

  • delete existing and recreate

    • make one beta and then then as usual version up.

Not happy though :-(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlandsmancars picture tlandsmancars  路  3Comments

k06a picture k06a  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

hmistry picture hmistry  路  3Comments

pronebird picture pronebird  路  3Comments