'Google/Analytics.h' file not found - XCode 7

前端 未结 2 2140
耶瑟儿~
耶瑟儿~ 2021-02-19 09:37

I am having much trouble integrating Google Analytics SDK into my iOS project. I am using XCode 7 and targeting iOS 7. Using Swift 2.0. However I can get the sample working ok (

2条回答
  •  渐次进展
    2021-02-19 10:12

    Solved it by going away from Googles own tutorial and not use GGLContext and importing headers directly.

    My podfile:

    platform :ios, ’7.0’
    use_frameworks!
    
    pod 'GoogleAnalytics'
    

    And BridgingHeader.h:

    #import "GAI.h"
    #import "GAIDictionaryBuilder.h"
    #import "GAIFields.h"
    

    And setup:

    let gai = GAI.sharedInstance()
    let id = "my-GA-id"
    gai.trackerWithTrackingId(id)
    gai.trackUncaughtExceptions = true 
    gai.logger.logLevel = GAILogLevel.Verbose
    

    Also added to User Header Search Paths:

    $(SRCROOT)/Pods/GoogleAnalytics (recursive)
    

提交回复
热议问题