我刚刚将their iOS developer guide中所述的Google Analytics Pod包含在内:
pod 'Google/Analytics'
运行时
pod install
它安装以下依赖项:
Installing FirebaseAnalytics (3.2.0)
Installing FirebaseInstanceID (1.0.6)
Installing Google (3.0.3)
Installing GoogleAnalytics (3.14.0)
Installing GoogleInterchangeUtilities (1.2.1)
Installing GoogleSymbolUtilities (1.1.1)
Installing GoogleUtilities (1.3.1)
由于我不使用Firebase,我想摆脱FirebaseAnalytics
和FirebaseInstanceID
(以及框架本身不需要的所有pod)。
安装未使用的依赖项只会增加我的应用程序大小。我只想安装绝对最少数量的pod来运行GoogleAnalytics 。
关于如何踢掉未使用的Pod的任何想法?
答案 0 :(得分:4)
如this answer所示,您可以使用:
pod 'GoogleAnalytics'
...以避免安装依赖项。请注意,您需要在桥接头文件中更改Objective-C导入;我至少需要:
#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>