How to Reinstall Pods in a Expo React native bare project in MacOS

Cocoapod is a package dependency manager for Objective-C and Swift projects with XCode. In a expo bare development environment you may need to re-install Cocoapods or in short Pods occasionally.

In this tutorial I will show you the proper way to re-install pods in a bare react native project setup. For example you may need to remove all pods and its cache to debug some errors or warnings due to changes in system.

Before re-installing you must delete cache from wherever ios concerns; Here’s the process I do to clear its cache:

  1. Delete npm cache:
    npm cache clean --force
  2. Delete All ios temp files:
    cd ios && rm -rf Pods/ Podfile.lock {yourProject}.xcworkspace
  3. Clear Cocoapods Cache:
    rm -r ~/Library/Caches/CocoaPods
  4. Now install pods via npx:
    cd .. && npx pod-install
  5. You can also install from ios directlry by running
    pod install

Conclusion

In this simple example I have shown you an example of re-installing Cocoapods or in short Pods by clearing cache and removing caching folders and files in a MacOS system environment.

Leave a Reply