I added an external framework via cocoapods into my iOS application. How can i remove that library from the project?
10 Answers
Remove lib from Podfile, then pod install
again.
-
13When I do this, I'm left with dozens of warnings in XCode 5 complaining that the workspace can't find the removed files. I've tried to manually clean this up but have not been successful. How can you cleanly remove a pod? Dec 19, 2013 at 1:18
-
8Find the pods file in Finder, then delete each of the individual pods (you'll notice they're missing the .h and .m files). Then
pod update
. That worked for me.– AMayesJan 9, 2014 at 22:32 -
1Also remember if library A is referenced by library B, which is also in Podfile, library A won't be removed even if you remove its entry and run "pod install". Library A will only be removed if you also removed the entry for library B.– CodeBrewMar 6, 2015 at 5:20
-
9You also get the warnings that @MattMombrea mentions if you successfully deleted the podfiles, but haven't committed the change. Make sure everything is committed to the code repository. Oct 2, 2015 at 11:10
-
2I want to delete a framework installed by pod without updating or installing podfile Nov 18, 2016 at 11:03
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:
Install clean:
sudo gem install cocoapods-clean
Run deintegrate in the folder of the project:
pod deintegrate
Clean(this tool is no longer available):pod clean
Modify your podfile (delete the lines with the pods you don't want to use anymore) and run:
pod install
Done.
-
2This pod should be the accepted answer, because it is much more thorough. Although, before following this workflow, I would suggest to clear the contents of the project's Derived Data directory, and make sure to commit the project's changes to the existing code repository. Finally, after running
pod install
, I opened the Xcode xcworkspace file, performed a full clean on the build folder (alt+shift+command+K), and the warnings/linker errors were gone. Pods were now successfully uninstalled from the project. Jan 30, 2017 at 21:30 -
1Note to @All: This command
cocoapods-clean
deletes thePodfile
and.xcworkspace
– SuhaibJun 15, 2017 at 11:02 -
10Seems now
pod deintegrate
is official: guides.cocoapods.org/terminal/commands.html#pod_deintegrate No need forsudo gem install cocoapods-deintegrate
.– PangAug 7, 2017 at 4:54 -
5I second that from @ZinWinHtet, when I try
pod clean
I get:$ pod clean [!] Unknown command: clean
Sep 21, 2018 at 22:12 -
4
Remove the library from your Podfile
Run
pod install
on the terminal
-
If I'm using Flutter, can I run
flutter clean
-flutter pub get
instead ofpod install
? Just wondering... Aug 3, 2022 at 6:54 -
Hey..... There are no pod names in my
Podfile
! 😲 There's only the line:flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
!... In thePodfile.lock
file, there's a list of pod names, but I'm not supposed to edit that one, am I?..... 🙄 Aug 3, 2022 at 7:21
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.
-
3You don't need to update all the libraries in your project (something that can be very dangerous) just to remove a library. There are much better ways in this thread including removing the pod from your podfile and then running
pod install
May 26, 2020 at 20:20 -
1This updates all versions of your libraries and naturally removes the one that is not present anymore in the Podfile, but do you really want to update the libraries ? Removing the pod and
pod install
is the correct way. Jun 2, 2020 at 23:25 -
Hey..... There are no pod names in my
Podfile
! 😲 There's only the line:flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
!... In thePodfile.lock
file, there's a list of pod names, but I'm not supposed to edit that one, am I?..... 🙄 Aug 3, 2022 at 7:21
To completely remove Pod or Cocoapods Framework from your Project repository !
sudo gem install cocoapods-clean
pod deintegrate
pod clean
Then Try to remove the File
Pods
Podfile
Podfile.lock
yourProjectName.xcworkspace
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
-
3The question was not how to remove cocoapods!!... 😏 The qn is how to remove A LIBRARY that was installed via cocoapods! Aug 3, 2022 at 6:44
Remove the Pod without hurting other Pods or their versions.
remove the pod that is no longer needed from the PodFile and run
pod install --no-repo-update
- Remove pod name(which to remove) from Podfile and then
- Open Terminal, set project folder path
- Run pod install --no-integrate
-
1
-
Hey..... There are no pod names in my
Podfile
! 😲 There's only the line:flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
!... In thePodfile.lock
file, there's a list of pod names, but I'm not supposed to edit that one, am I?..... 🙄 Aug 3, 2022 at 7:26
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.
-
Hey..... There are no pod names in my
Podfile
! 😲 There's only the line:flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
!... In thePodfile.lock
file, there's a list of pod names, but I'm not supposed to edit that one, am I?..... 🙄 Aug 3, 2022 at 7:21
Got this trying to install google_sign_in with flutter. Just had to remove the AppAuth library stuff from cocoapods, then 'pod install' in ios directory. Then I had to remove the flutter plugin, then I had to reinstall flutter plugin, then redo pod install. Then it worked. So I guess weird caching.