Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including Google Analytics in Swift Bridging Header

This has actually been driving me crazy.

I've been following the instructions on the Google Developer's site (which doesn't actually have an import line, but if you inspect the element you can kinda notice that someone messed up and it's supposed to be #import <Google/Analytics.h>)

But Xcode just refuses to find the Google Analytics, while it imports the other header in my bridging header perfectly alright (e.g. it reads the file fine, but only does one of the imports).

My file looks like this:

#import <workinglibrary.h>
#import <Google/Analytics.h> // this doesn't work!

I've tried every variation of <Analytics.h> or "Google/Analytics.h" and so on. My header search paths looks fine too:

"${PODS_ROOT}/Headers/Public/Google"
"${PODS_ROOT}/Headers/Public/Google/Google"
"${PODS_ROOT}/Headers/Public/GoogleAnalytics"
...

Final caveat: I'm not sure (since Xcode doesn't fully build when I do this), but I think that Xcode properly imports the Analytics.h file if I comment out the #import <workinglibrary.h> statement (at least, I can Apple + Click analytics functions in other files to get to their declaration).

EDIT: just kidding that last bit isn't true

like image 665
aspin Avatar asked Jun 29 '15 17:06

aspin


1 Answers

I had same issue. This has been fixed in cocoapods 0.38.2

To update use: gem install cocoapods

You can use_frameworks!

like image 56
Krešimir Prcela Avatar answered Oct 21 '22 16:10

Krešimir Prcela