Cocoapods Private Repo not pulling correct code for tag
I was so excited to get a private CocoaPods repo working. I got v1.0 of my little internal library working with my main app like a charm. Then I added something to the library, committed it, tagged it with v1.1, pushed it up and everything went straight to hell.
No matter what I do, even though my main app reports that my internal library is pointed at
1.1, I keep getting the same code back as
1.0. I’m stumped.
Things I have verified:
- My private pods repo has the correct folder structure, and the
.podspecfiles in each folder have the appropriate
- Did a file compare of the two
podspecfiles on my internal pods repo and confirmed that the only change to the file was the version number.
- Did a
git checkout tags/1.1on the repo with the internal library and confirmed the
1.1tag contains the appropriate commit.
- Confirmed via the BitBucket website the file changes and tag for
1.1made it there.
I have also tried the following things to resolve it (that I can remember right now) and still got the same code added in the Pod.
- Removing the offending pod from the Podfile, running
pod updateto delete it, re-adding it, then running
- Removing my remote pod repo via
pod repo remove [NAME]and then re-adding it under a different name.
- Pointing the podspec at :head
- Pointing the podspec at the specific commit I wanted.
- Pointing the podspec at my local copy of the library.
All this craziness points to some sort of caching issue with git or Xcode, but running CocoaPods in verbose mode doesn’t seem to show anything other than super-temporary cache paths that get deleted the second
pod update is done.
Anybody got any further suggestions? This is driving me bananas.
Update 1/24: I checked out the code under a seperate username and got some odd behavior:
pod install Analyzing dependencies Downloading dependencies Installing [Private Library] (1.0) Installing Google-Mobile-Ads-SDK (6.7.0) Installing LARSAdController (3.0.3) Installing UIAlertView-Blocks (0.0.1) Generating Pods project Integrating client project [!] From now on use `[App Name].xcworkspace`.
Interesting, I thought, that it grabbed the 1.0 version even though I don’t specify any version in the Podfile. So then I ran:
pod update Analyzing dependencies Downloading dependencies Installing [Private Library] (1.1) Using Google-Mobile-Ads-SDK (6.7.0) Using LARSAdController (3.0.3) Using UIAlertView-Blocks (0.0.1) Generating Pods project Integrating client project
And the code doesn’t change, even though the version number increments. So this points to something I screwed up rather than a caching issue – but if I did, why the hell is it grabbing version 1.0 at all? Any thoughts?
One Solution collect form web for “Cocoapods Private Repo not pulling correct code for tag”
Welp, this was a PEBKAC/not seeing the forest for the trees problem, which I realized when I tried to give up and switch to a git submodule and saw what appeared to be the same issue.
I’d pointed the CocoaPod at
/[Project Root]/Library (and was initially looking in there when I tried to move to a git submodule), but when I’d dragged that folder into Xcode in the library project, I’d accidentally left the “Copy Items Into Destination Group’s Folder (if needed)” checkbox checked. That created
/[Project Root]/[Subfolder]/Library, where all of my changes were actually going. Once I fixed that, surprise surprise, everything worked fine.
So, uh, I guess the lesson here is that if you’ve gotten this far down the rabbit hole, step back and make sure there’s even a rabbit you need to be chasing to begin with.