Google 分析子规范不存在

Google Analytics subspecs not present

我在我从事的一些项目中使用 Google Analytics iOS SDK。我一直在尝试将它安装在最新的一个上,并且 运行 遇到了最奇怪的问题。我遇到的问题是库和一切构建正常,我已经为我正在处理的应用程序生成了一个配置文件,看起来也不错但是一旦我 运行 我收到以下消息在我的控制台中:

Attempted to configure [Identity, Analytics, AdMob, SignIn, AppInvite, CloudMessaging].
2015-07-09 09:02:10.738 [19018:5111252] Successfully configured [].
2015-07-09 09:02:10.738 [19018:5111252] Failed to configure [].
2015-07-09 09:02:10.738 [19018:5111252] Subspecs not present, so not configured [Identity, Analytics, AdMob, SignIn, AppInvite, CloudMessaging].

无论我尝试过什么,我都无法正确配置 Analytics :/

还有其他人 运行 遇到过这个问题吗?我什至尝试为另一个正在运行但也不起作用的应用程序配置文件。任何帮助将非常感激!

我也在 Google 开发者论坛上发帖:https://groups.google.com/forum/?fromgroups#!topic/ga-mobile-app-analytics/aqM-SqNqQLo

谢谢,

尼克

您应该在您的应用中添加 GoogleService-Info.plist。 https://developers.google.com/mobile/add?platform=ios&cntapi=analytics&cnturl=https:%2F%2Fdevelopers.google.com%2Fanalytics%2Fdevguides%2Fcollection%2Fios%2Fv3%2Fapp%3Fconfigured%3Dtrue%23add%2Dconfig&cntlbl=Continue%20Adding%20Analytics

您的跟踪 ID 和应用程序包应包含在 plist 文档中。 还要确保文档中的 IS_ANALYTICS_ENABLED TRUE。

没关系。你可以忽略它。对我来说,我使用下面的代码来实现事件跟踪:

id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-000000-1"];
NSMutableDictionary *event = [[GAIDictionaryBuilder createEventWithCategory:category
                                        action:action
                                         label:nil
                                         value:nil] build];
[tracker send:event];

而不是

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

gai.logger.logLevel = kGAILogLevelVerbose; // 在应用发布前移除

上面一行可能已经被评论了。

TL;DR
IS_ADS_ENABLED 设置为 NO,或任何其他冲突设置
(IS_APPINVITE_ENABLED, IS_GCM_ENABLED, IS_SIGNIN_ENABLED)
请注意,除了 IS_ADS_ENABLED

之外,我没有遇到此错误

我不确定这是否是您的问题,但我在尝试使用 AdMob for iOS which looks like it is in beta while also trying to use Analytics for iOS (version ~> 7.0) 时遇到了同样的错误。我遇到这个问题是因为 iOS 的分析使用 GoogleService-Info.plist 进行配置,我将 IS_ADS_ENABLED 设置为 YES。将值更改为 NO 解决了我的问题。

在我的案例中,问题是我的文件夹带有 SignIn 框架。我删除了它,然后从 pods 安装。

例如 google 登录:

'pod 'Google/SignIn'