我刚刚包含了 Google Analytics Pod,如 their iOS developer guide 中所述与:
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 有什么想法吗?
最佳答案
如 this answer 所示,你可以使用:
pod 'GoogleAnalytics'
...避免安装依赖项。请注意,您需要更改桥接头文件中的 Objective-C 导入;我至少需要:
#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
关于ios - Google Analytics Pod 安装了太多依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37529747/