Is it possible to exclude dependency in Cocoapods?

Nikola Klipa picture Nikola Klipa · Nov 17, 2016 · Viewed 7.3k times · Source

Firebase/Messaging have dependencies on:

Using Firebase
Using FirebaseAnalytics
Using FirebaseCore
Using FirebaseInstanceID
Using FirebaseMessaging
Using GoogleInterchangeUtilities
Using GoogleSymbolUtilities
Using GoogleToolboxForMac

I would like to know is it possible to exclude GoogleToolboxForMac? Problem is that I have one static library included that already use GoogleToolboxForMac without cocoapods.

So just want to know is it possible or not?

Answer

xySVerma picture xySVerma · Aug 14, 2017

A better solution to exclude dependency would be to use local pod spec file like this build on the top of original one.

pod 'Firebase/Messaging', :podspec => 'FirebaseMessaging.podspec.json'

:: e.g. usage :: 1) Visit > https://cocoapods.org/pods/FirebaseMessaging

2) Click on 'See Podspec' (You will be redirected to existing spec on github)

3) Download this file by clicking 'Raw' followed by 'Save File As'.

4) Place this file in same directory as podfile of your xcode project

5) Edit this file and remove dependency you are not interested in.

6) Thats all. Execute pod install or pod update whichever is more relevant to you and dependency won't be installed any more.

To be noted: If FirebaseMessaging pod is updated in future, you will have to keep your local pod file in sync by yourself.