我在一个空白的iOS项目上尝试了一个POC,为最新版本的GoogleTagManager和Firebase / Core安装了pod. POC工作正常,我能够发送事件,事件记录到服务器上的GA.
但是,当我安装GTM和Firebase / Core的最新版本,同样的GoogleServices-info.plist,同样的GTM-XXXXXXX.json时,我发现我的应用程序崩溃,我可以看到“GoogleTagManager信息:正在加载容器:GTM-XXXXXXX”我控制台的最后一行.
Removing GoogleInterchangeUtilities Downloading dependencies Installing Firebase 4.3.0 (was 3.7.1) Installing FirebaseAnalytics 4.0.4 (was 3.4.4) Installing FirebaseCore 4.0.8 (was 3.4.3) Installing FirebaseInstanceID 2.0.4 (was 1.0.9) Using GoogleAnalytics (3.17.0) Using GoogleSymbolUtilities (1.1.2) Installing GoogleTagManager 6.0.0 (was 5.0.8) Installing GoogleToolBoxForMac (2.1.3) Using GoogleUtilities (1.3.2) Installing nanopb (0.3.8)
当我删除GoogleTagManager并仅保留FirebaseAnalytics时,该应用程序运行良好,Firebase Analytics正在服务器上接收事件.
通过不同论坛上的不同线程和堆栈溢出,我尝试将GTM和Firebase降级为GoogleTagManager -v5.0.8和Firebase / Core -v3.7.1以及FirebaseAnalytics.请注意,我没有提及FirebaseAnalytics的任何首选版本.令我惊讶的是,我的应用程序开始工作,并没有在任何地方破坏.但是,现在我看到,Firebase事件正在解雇,但GA没有收到任何事件.另外,我在控制台中看到事件的参数传递为null.
GoogleTagManager info: Processing logged event: gtm.load with parameters: (null)
Pod安装日志 –
Downloading dependencies Installing Firebase 3.7.1 (was 4.3.0) Installing FirebaseAnalytics 3.4.4 (was 4.0.4) Installing FirebaseCore 3.4.3 (was 4.0.8) Installing FirebaseInstanceID 1.0.9 (was 2.0.4) Using GoogleAnalytics (3.17.0) Installing GoogleInterchangeUtilities (1.2.2) Using GoogleSymbolUtilities (1.1.2) Installing GoogleTagManager 5.0.8 (was 6.0.0) Using GoogleUtilities (1.3.2)
我不确定我的申请中出了什么问题.哪个库与Firebase或GoogleTagManager存在冲突?相同的设置在空白项目上正常工作.
我的应用程序使用其他一堆手动添加的框架(不是通过Cocoapods) – AWS Frameworks,CyptoSwift,DropDown,Timberjack,Alamofire,Charts,Gloss,SwiftValidator,SwiftyJSON,SDWebImage,AWSFacebookSignIn,AWSGoogleSignIn,Blots,FBSDKCoreKit,FBSDKLoginKit,GoogleAppUtilities,GoogleAuthUtilities,GoogleNetworkUtilities,GoogleSignin,SafariServices.
希望有助于识别冲突,如果有的话.
The reason I say conflict is because the latest versions of
GoogleTagManager and Firebase works fine in the blank app POC that I
did with the same GoogleServices-info.plist and GTM-XXXXXXX.json file.
Also,the app works when I downgrade the versions of GTM and Firebase,
however in that case the GA stops receiving the events.
控制台日志:
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Core][I-COR000005] No app has been configured yet.
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Analytics][I-ACS024000] Debug mode is on
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Analytics][I-ACS023009] Debug logging enabled
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Core][I-COR000005] No app has been configured yet.
2017-10-17 09:39:30.349 XX-Shell[88944:5891923] GoogleTagManager info: Loading container: GTM-XXXXXXX
initializingUserPool2017-10-17 09:39:30.352 XX-Shell[88944:5891910] GoogleTagManager info: Attempting to load container GTM-XXXXXXX from network
Oct 17 09:39:30 XX-Shell[88944] : [Firebase/Analytics][I-ACS025018] Event not logged. Call +[FIRApp configure]: gtmTrackEvent_screenView
Update: 26Oct2017
I found the conflicting libraries – GoogleUtilities,
GoogleNetworkingUtilities and GoogleSymbolUtilities. I copied all my
project releated framework in my poc and i was able to replicate the
issue. I started removing one library at a time and i circled on these
3 libraries causing problem (when they are together). Hope google will
look into this issue and have an update soon. My problem with actual
project is,i have too many sub projects in it and i will have to
resolve conflicts (google and other) all together for all the sub
projects.. and that is a tedious task,