FreeGor
FreeGor

Reputation: 624

Import GoogleAnalytics headers into a Swift Framework?

It's the repetition of this question without a correct answer. I try to add Google Analytics to my framework, but it's not working. The umbrella header file have the error on #import <Google/Analytics.h>: "include of non-modular header inside framework module 'FrameworkName': '/Users/.../Pods/Headers/Public/Google/Google/Analytics.h'"

Allow Non-modular includes in Framework Modules is YES. Umbrella header is Public. What else? I spent two days searching for an answer with no result. Please help.

Upvotes: 1

Views: 631

Answers (1)

FreeGor
FreeGor

Reputation: 624

Ok, I have solved it. First I replaced the 'Google/Analytics' pod to the 'GoogleAnalytics' (without slash) because the first is deprecated. Second in the project where I'm using my framework, in it bridging file I set follow:

#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"'

instead of #import <Google/Analytics.h>

Third I removed GoogleService-Info.plist file from the project and add GUI tracker ID setup to code, as described in Google documents. Done.

Upvotes: 1

Related Questions