在swift 2和xcode 7 beta 4中设置Google分析时出错

编程入门 行业动态 更新时间:2024-10-10 14:30:05
本文介绍了在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无法在处理过程中找到 - 但我无法弄清楚为什么?我查看了指南 developers.google/ 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 developers.google/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分析时出错

本文发布于:2023-11-26 10:38:14,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:xcode   swift   Google   beta

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!