Remove or uninstall library previously added : cocoapods

IosIphoneIpadCocoapods

Ios Problem Overview


I added an external framework via cocoapods into my iOS application. How can i remove that library from the project?

Ios Solutions


Solution 1 - Ios

Remove lib from Podfile, then pod install again.

Solution 2 - Ios

The unwanted side effects of simple folder delete or installing over existing installation have been removed by a script written by Kyle Fuller - deintegrate and here is the proper workflow:

  1. Install clean:

    sudo gem install cocoapods-clean
    
  2. Run deintegrate in the folder of the project:

    pod deintegrate
    
  3. Clean (this tool is no longer available):

    pod clean
    
  4. Modify your podfile (delete the lines with the pods you don't want to use anymore) and run:

    pod install
    

Done.

Solution 3 - Ios

  1. Remove the library from your Podfile

  2. Run pod install on the terminal

Solution 4 - Ios

None of these worked for me. I have pod version 1.5.3 and the correct method was to remove the pods that were not longer needed from the Podfile and then run:

pod update

This updates your Podfile.lock file from your Podfile, removes libraries that have been removed and updates all of your libraries.

Solution 5 - Ios

  1. Remove pod name(which to remove) from Podfile and then
  2. Open Terminal, set project folder path
  3. Run pod install --no-integrate

Solution 6 - Ios

First, determine which versions of Cocoapods are installed :

gem list --local | grep cocoapods

You get output as this:

cocoapods (1.11.2)
cocoapods-clean (0.0.1)
cocoapods-core (1.11.2, 1.10.2, 1.10.1)
cocoapods-deintegrate (1.0.4)

To completely remove, issue the following commands:

gem uninstall cocoapods
gem uninstall cocoapods-clean
gem uninstall cocoapods-core
gem uninstall cocoapods-deintegrate

Running again to confirm that Cocoapods has been removed:

gem list --local | grep cocoapods

You may have residual artefacts in a hidden folder in your directory. Remove these with:

rm -rf ~/.cocoapods

Solution 7 - Ios

Remove pod name from Podfile then Open Terminal, set project folder path and Run pod update command.

NOTE: pod update will update all the libraries to the latest version and will also remove those libraries whose name have been removed from podfile.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLithu T.VView Question on Stackoverflow
Solution 1 - IosfannheywardView Answer on Stackoverflow
Solution 2 - IosMichalView Answer on Stackoverflow
Solution 3 - Iosuser5807443View Answer on Stackoverflow
Solution 4 - IossrcView Answer on Stackoverflow
Solution 5 - IosK.DView Answer on Stackoverflow
Solution 6 - IosSai SiddeshwarView Answer on Stackoverflow
Solution 7 - IosRoohulView Answer on Stackoverflow