2015-08-14 40 views
2

我使用cocoapods設置了我的xcode項目,並將Google分析添加爲pod。之後,我在項目文件的正下方導入了GoogleService-info.plist。 Bridge頭部也被創建,代碼添加到AppdDelegate中。在編譯過程中,一切都正常運行,但是當我開始調試,我收到這些錯誤:在swift 2和xcode 7 beta 4中設置谷歌分析時出現錯誤

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 

調試stopps此屏幕:

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 

似乎對我說的.plist不能是在加工過程中發現 - 但我不明白爲什麼?我仔細檢查了指南https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift,但仍然無法弄清楚問題所在。

回答

1

我現在解決了這個問題。我將我的cocoapods文件從/ Google更改爲/ GoogleAnalytics - 並且工作正常。 -

+0

嗨,我似乎遇到了同樣的問題,但不能夠按照你的答案,哪個cocoapods文件你在說abt,你能幫我在這個 – Geet

+0

因爲我只需要谷歌分析,而不是整個包裝與谷歌廣告等,我改變了可可豆莢ini文件,並使用/ GoogleAnalytics而不是/谷歌在那裏。 –