在swift 2和xcode 7 beta 4中设置Google分析时出错 [英] Error when setting up google analytics in swift 2 and xcode 7 beta 4

查看:139
本文介绍了在swift 2和xcode 7 beta 4中设置Google分析时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用cocoapods设置了我的xcode项目,并将Google分析添加为pod。之后,我在项目文件的正下方导入了GoogleService-info.plist。 Bridge头部也被创建,代码添加到AppdDelegate中。在编译期间,一切运行良好,但是当我启动调试器时,我收到了这些错误:

  2015-08-14 16: 45:25.866 GetOut [30738:3729265]客户端ID不能为零或空。 
2015-08-14 16:45:25.867 GetOut [30738:3729265]客户端ID不能为零或空。
2015-08-14 16:45:25.867 GetOut [30738:3729265] GCM发件人ID不能为零或空。
2015-08-14 16:45:25.867 GetOut [30738:3729265]试图配置[Identity,Analytics,AdMob,SignIn,AppInvite,CloudMessaging]。
2015-08-14 16:45:25.867 GetOut [30738:3729265]成功配置[Analytics,AdMob]。
2015-08-14 16:45:25.867 GetOut [30738:3729265]无法配置[SignIn,AppInvite,CloudMessaging]。
2015-08-14 16:45:25.867 GetOut [30738:3729265]子规格不存在,因此未配置[标识]。
声明失败:配置Google服务时出错:可选(错误域= com.google.greenhouse代码= -200无法配置GGL。UserInfo = 0x170661400 {NSLocalizedRecoverySuggestion =检查GoogleService-Info.plist的格式和位置。 ,NSLocalizedDescription =无法配置GGL,NSLocalizedFailureReason =无法解析提供的GoogleService-Info.plist。请参阅日志以获取详细信息。):file / Users / xxx / Documents / Eigene Dateien / Appdesign / GetOut / GetOut / GetOut / AppDelegate。 swift,line 30

调试器停止显示此屏幕:​​

  0x1006bdeec< + 144>:bl 0x1006fc228;函数签名专业化< Arg [0] =分解,Arg [1] =分解,Arg [2] =分解> (闭包#1)(闭包#1)
0x1006bdef0< + 148>(闭锁#1)(Swift.StaticString,Swift.String,Swift.StaticString,Swift.UInt) - > :mov x0,x24
0x1006bdef4< + 152>:bl 0x100749c50; swift_release
0x1006bdef8< + 156> ;: mov x0,x19
0x1006bdefc< + 160>:bl 0x100756cc8; swift_unknownRelease

在我看来,.plist无法在处理过程中找到 - 但我无法弄清楚为什么?我查看了指南 https://developers.google.com/ analytics / devguides / collection / ios / v3 /?ver = swift ,但仍然无法弄清楚问题所在。 解决方案

我现在解决了这个问题。我将我的cocoapods文件从/ Google更改为/ GoogleAnalytics - 并且工作正常。 -


I set up my xcode project wit cocoapods, added google analytics as pod. Afterwards I imported the GoogleService-info.plist directly below my project file. Bridge header is also created, and code added in the AppdDelegate. During compilation, everything runs fine, but when I start the debugger, I receive those errors:

2015-08-14 16:45:25.866 GetOut[30738:3729265] Client ID must not be nil or empty.
2015-08-14 16:45:25.867 GetOut[30738:3729265] Client ID must not be nil or empty.
2015-08-14 16:45:25.867 GetOut[30738:3729265] GCM Sender ID must not be nil or empty.
2015-08-14 16:45:25.867 GetOut[30738:3729265] Attempted to configure [Identity, Analytics, AdMob, SignIn, AppInvite, CloudMessaging].
2015-08-14 16:45:25.867 GetOut[30738:3729265] Successfully configured [Analytics, AdMob].
2015-08-14 16:45:25.867 GetOut[30738:3729265] Failed to configure [SignIn, AppInvite, CloudMessaging].
2015-08-14 16:45:25.867 GetOut[30738:3729265] Subspecs not present, so not configured [Identity]. 
assertion failed: Error configuring Google services: Optional(Error Domain=com.google.greenhouse Code=-200 "Unable to configure GGL." UserInfo=0x170661400 {NSLocalizedRecoverySuggestion=Check formatting and location of GoogleService-Info.plist., NSLocalizedDescription=Unable to configure GGL., NSLocalizedFailureReason=Unable to parse supplied GoogleService-Info.plist. See log for details.}): file /Users/xxx/Documents/Eigene Dateien/Appdesign/GetOut/GetOut/GetOut/AppDelegate.swift, line 30

The debugger stopps with this screen:

0x1006bdeec <+144>: bl     0x1006fc228               ; function signature     specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Exploded> of Swift.(_assertionFailed (Swift.StaticString, Swift.String, Swift.StaticString, Swift.UInt) -> ()).(closure #1).(closure #1)
0x1006bdef0 <+148>: mov    x0, x24
0x1006bdef4 <+152>: bl     0x100749c50               ; swift_release
0x1006bdef8 <+156>: mov    x0, x19
0x1006bdefc <+160>: bl     0x100756cc8               ; swift_unknownRelease

It seems for me that the .plist cant be found during processing - but I can not figure out why? I checked the guide https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift carefully, but still can not figure out what the problem is.

解决方案

I fixed the issue now. I changed my cocoapods file from /Google to /GoogleAnalytics - and it worked. –

这篇关于在swift 2和xcode 7 beta 4中设置Google分析时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆