Cocoapods: how to delete one pod manually? - xcode

How to delete one pod manually with Cocoapods in Xcode?
I knew pod deintegrate, I have seen How to remove CocoaPods from a project?
It is too hard for me. Need more details, or a tutorial.
The reason of doing it:
I take part in an old, massive project.There are thousands of warnings there . So I want to maintain a personal version of the project.
When starting to delete one pod ,failed after running pod install
the warnings:
term pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.5.0) is higher than the version of the current executable (1.4.0). Incompatibility issues may arise.
Cloning spec repo `z-appplatform-zspecs` from `http://git.zsys.com/AppPlatform/zSpecs.git`
[!] Unable to add a source with url `http://git.zsys.com/AppPlatform/zSpecs.git` named `z-appplatform-zspecs`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
The remote repos are of my company's server, I need authorization (secret).
After a lot of communication with my leader, he said "The pods don't need to update. And he can't give me the authorization to remote repo, he will manually do it for me"
Not convenient, with trying a lot to improve a massive project.

Related

Can't add "MidiParser" pod to Podfile

I am trying to add this github project to my project as a pod: https://github.com/matsune/MidiParser
In my PodFile, I have tried
pod 'MidiParser'
and
pod 'MidiParser', :git => 'https://github.com/matsune/MidiParser.git'
but either time I get the error
Unable to find a specification for 'MidiParser'.
I have tried adding other pods like 'https://github.com/daltoniam/SwiftHTTP' just to see if they work, and they do. I notice there are multiple projects on GitHub called MidiParser, so maybe I need to distinguish between them somehow? The installation instructions in the MidiParser README only give instructions for Carthage. It says to add this line to the Cartfile:
github "matsune/MidiParser"
I also have also tried:
pod 'matsune/MidiParser'
I notice I can't find the project when I search for it here: https://cocoapods.org.
Does that mean I simply can't install the project using Cocoapods, and that I have to do it manually?
Edit: I ended up using Carthage.
CocoaPods requires pods to be specified with a podspec to describe its Xcode workspace integration. See https://guides.cocoapods.org/making/making-a-cocoapod.html

Cocoa pod v0.39.0 not working with Xcode 8

My current project using cocoa pods of version 0.39.1, and my current pod version in my system is 1.1.1, so when i try to install the cocoa pods in my project path, it gave me warning saying
[!] Invalid Podfile file: [!] Unsupported options {:exclusive=>true} for target Xxx Xxx XxxxTests..
so i have uninstalled pod v1.1.1 and installed 0.39.1. Now when i run install command i get another warning
[!] The master repo requires CocoaPods 1.0.0 - (currently using 0.39.0) Update Cocoapods, or checkout the appropriate tag in the repo.
i'm aware that Xcode 8: Only works with CocoaPods 1.1.0
Should i update my project pod file to latest pod version or should i work with lower version of xcode so it supports v0.39.0
I recently completed a project where I had to migrate a dozen or so (private) Cocoapods from 0.39 up to 1.1.X.
It's actually not that hard, once you get the hang of it (and, at least in my case, the Podfile I put together for 1.1.X continued to work the occasional times I had to drop back down to Pods 0.39)
As you've discovered, you do need to remove ":exclusive => true" and "link_with" (which gets replaced with abstract_target). More information can be found in this Pods migration guide. Here is another "mini" example.
And other people have asked related questions here before. My recommendation is to go up to Xcode 8, otherwise you'll won't be able to do pod update and keep up to date with the latest changes in the Pods you're trying to leverage in your code.

Use private podspec repo only with Cocoapods

I host a private podspec repo internally, and I would like to use Cocoapods without depending on the public master spec repo. Is there a way to remove dependency on the master spec repo entirely?
The issue is that my company is frozen at cocoapods 0.34.1, and cannot update in time. However, recent changes to the master repo require a min version of 0.35.0. Any time I try to run any pod command, I get the following message.
[!] The "master" repo requires CocoaPods 0.35.0 - (currently using 0.34.1)
I understand what that means, and would like to remove the master repo as a dependency altogether, but it seems like that isn't an option. Any insights?
This created quite the fire drill for us today. We ended up changing our build scripts to run a custom pod install alias, which rolls back the min version in the CocoaPods-version.yml.
alias myPodInstall="sed -i -e 's/min: 0.35.0/min: 0.34.0/' ~/.cocoapods/repos/master/CocoaPods-version.yml; pod install"
Definitely a hack, but it unblocked us as we push for our release. Perhaps this helps others out there in a similar situation.

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 .podspec files in each folder have the appropriate s.version
Did a file compare of the two podspec files on my internal pods repo and confirmed that the only change to the file was the version number.
Did a git checkout tags/1.1 on the repo with the internal library and confirmed the 1.1 tag contains the appropriate commit.
Confirmed via the BitBucket website the file changes and tag for 1.1 made 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 update to delete it, re-adding it, then running pod update again.
Clearing ~/Library/Caches/CocoaPods and [ProjectRoot]/Pods and running pod install.
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?
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.

Renaming default Cocoapods project

Is it possible to rename the default Pods xcodeproj and Pods subdirectory that are generated when you run pod install? Is there any way in the Podfile or pass an argument to pod install to do this? I couldn't find anything that suggested this on the http://cocoapods.org documentation.
This is not currently an option of any kind in CocoaPods. If you would like to see this in a future version we gladly accept pull requests over on Github

Resources