CocoaPod : Unable to remove the Pod from project - ios

I have a xcode (iOS) project in which i am cocoapods.
I have couple of pods installed:
SwiftHTTP & SwiftyJSON.
Now for some reason I decided to try another pod namely EZAlertController. Nothing wrong with the pod. But i decided not to use it. So I need to uninstall this pod from my project.
So far whatI have done:
remove pod 'EZAlertController', '0.3'from the podfile
run pod install which gave me the message of
Removing EZAlertController
No EZAlertController folder in the Pods folder either. So far so good.
Now i closed the xcode and reran the .xcworkspace file.
clean & build routine - all good - Again
P.S.(also tried pod update)
The Problem:
I am still able to import EZAlertController into the project and run. What is really annoying is that I forgot to take a git snapshot. So can't just revert back without loosing considerable amount of code.
Any idea on how to completely get rid of EZAlertController even after removing as there is still some linking with xcode :(

Try to clean the project: Product -> Clean and also Product -> (hold option key) Clean Build Folder

Maybe deleting the derived data could resolve your issue

I wouldn't remove the pod. I've had this problem before. I tried blowing away all the pods but continued to experience the problem. What I would do is blow away all the pods, reinstall Cocoapods to the project, then try installing it again.
Alternatively you can add the framework you need manually.

Related

Error : The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation

I am not using Pods. But accidentally I installed it and deleted all folders from my project repo.
After that , when compiling shows this error message.
I searched podfile.lock file in my project folder but cannot find.
Then why such error
Help me to solve it.
There are probably some CocoaPods related files and rules left over. You can use the pod deintegrate command to remove CocoaPods from your project. See https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate
Make sure you have your project in version control or backed up before doing this, so if something goes wrong you can always roll back.

How to completely remove cocoa pods from project?

I have a project that had 3 cocoa pods installed. I decided I only need one of them, so I removed the other 2. I removed the two associated lines from my pod file and then ran pod install from the command line. It ran OK and said that removing the two cocoa pods was successful.
Yet when I go into my project, I am still able to import the libraries from those pods. I am still able to run functions specific to those pods. I have scoured my project and all of its files and I can't find any files related to those 2 pods, so how is it that function calls to those pods are still working? How do I actually get rid of these cocoa pods?
You can open the "podfile" and remove those pod lines and from terminal go and do the pod install and it will remove pods you just removed from the "podfile". For example remove line pod "TextFieldEffects".
Here you remove the higlighted line.
It will keep only the ones you kept in the "podfile" and removes everything else.
I was able to fix this by clearing the derived data and then doing a hard clean.
To clear derived data:
Select your Xcode project and go to Preferences.
In the Preferences Menu, select Location. Click on Arrow at trailing end of derived data.
The folder opens. Select all projects in DerivedData and move to trash.
To perform a hard clean:
Press Shift-Alt-Cmd-K
Once I did these steps, function calls to the removed cocoa pod libraries ceased to work.
Check Pods folder that exists in your project folder. If there exists this deleted libraries, than delete them, if not - than they are deleted from pods.

EMBEDDED_CONTENT_CONTAINS_SWIFT -- Error after pod install

I have a currently working cocoapods, however whenever I want to add frameworks and run pod install I get this warning in the terminal and the project does not compile.
I have followed what it is suggesting, I already had the inherited flag in my build settings, and I tried deleting the EMBEDDED_CONTENT_CONTAINS_SWIFT from target build settings.
I have to run a git reset --hard to go back to my working cocoapods after removing the framework I wanted to add.
Edit: Added my podfile
Okay, so after a lot of pain and suffering, I found the solution.
We cannot have frameworks in cocoapods use other frameworks in your podfile. I was using Atlas but added custom implementation that included MBProgressHUD which was the issue. I cannot import MBProgressHUD into Atlas because thats what was causing the issues above.
Not sure why but that was all there was to it.

When using cocoapods, what is the best way to change the PRODUCT_NAME?

I created an app with name "ABC". Months later I decided to change the name to "ABCD". I believe the way I changed it, was in my Podfile, I changed target "ABC" do to target "ABCD" do. However, I recall going through quite a few issues/errors afterward in my workspace that caused a lot of stress. It was so long ago that I can't quite recall though.
Now I'm ready to submit, and I want to change the name one last time. I've changed the name in iTunes Connect, but now I want to change my PRODUCT_NAME, and my bundle identifier to match.
What is the best way to do this? Should I change the target fields in my Podfile? Or should I leave them, and just change something else in Xcode? Or do I need to change both or more than one thing?
When you have a Pod file the .xcworkspace and Pods.xcodeproj is generated dynamically by the pod install process.
So one way to deal with this is
Change your product name
Close the project in Xcode
Discard the existing .xcworkspace, Pods folder & Podfile.lock
Run pod install again.
The cocoapods engine will regenerate its project, pull the Pods from its cache and recreate its Pods.xcodeproj with the new project settings.
This might be a little more complex in the case where you have other dependancies besides your main project and the Pods project in your workspace.
You'll probably want to have everything committed to source control before you do this so you can revert if it goes wrong.
I solved if for my project with this steps.
I install cocoapods-deintegrate
[sudo] gem install cocoapods-deintegrate
and call pod deintegrate on my project.
open XCode, click on project name and click again with delay to rename, follow xcode instructions
run pod install again on your project.
NOTE: if you are just Capitalising, or Uppercassing project name do it with other temp name: for me locdel->aaa->Locdel.
I've been scouting the internet to no avail looking for an answer to this. While editing the podfile and running pod install again fixes the renaming problem, in my case it broke my application as those pods had evolved while my app had stayed the same.
If you have concerns about backwards compatibility and don't want to reinstall your dependencies I suggest you do as I did and edit directly the .xcworkspace and .xcodeproj files using a text editor.

Trying to remove a pod with CocoaPods 0.36 Beta2

I am using CocoaPods with swift, therefor I need a pre release. I'm not sure whether I found a bug or maybe it's just a wrong thing I do.
If I want to remove a pod, I simly remove it from the podfile and call pod install again.
This works, but afterwards, the remaining frameworks are not recognized as frameworks anymore.
Is this the right way to remove pods and am I missing something? E.g. cleaning up my workspace or so?
Thanks
#Christian, removing from Podfile and running pod install at the command line should work. It sounds like a bug.
Can you post one or more errors about the frameworks so we have more to work with? Also, you should consider reporting it.

Resources