Google Analytics Pod installs too many dependencies

血红的双手。 提交于 2020-01-03 09:30:10

问题


I've just included the Google Analytics Pod as described in their iOS developer guide with:

pod 'Google/Analytics'

When running

pod install

it installs the following dependencies:

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)

Since I don't use Firebase, I would like to get rid of the FirebaseAnalytics and FirebaseInstanceID (as well as all pods that are not needed by the framework itself).

Installing unused dependencies only bloats up my app size. I would like to only install the absolute minimum amount of pods to get GoogleAnalytics running.

Any ideas on how to kick the unused Pods out?


回答1:


As seen in this answer, you can use:

pod 'GoogleAnalytics'

…to avoid installing the dependencies. Note that you'll need to change your Objective-C imports in your bridging header file; I needed at least:

#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>


来源:https://stackoverflow.com/questions/37529747/google-analytics-pod-installs-too-many-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!