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

前端 未结 2 2141
耶瑟儿~
耶瑟儿~ 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:09
    #import <GoogleAnalytics/GAI.h>
    

    Instead of:

    #import <GoogleAnalytics.h>
    

    This what worked for me, XCODE9.0.

    0 讨论(0)
  • 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)
    
    0 讨论(0)
提交回复
热议问题