0

With the Google cocoapod now deprecated I have switched to using the GoogleAnalytics pod and amended my bridging header to import the following:

#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"

Now my build keeps failing at:

GGLContext.sharedInstance().configureWithError(&configureError)

Can't find anything in the Google docs and Google searches have also proved fruitless.

A point in the right direction would be greatly appreciated, or even pointing out something painfully obvious that I'm missing.

mike
  • 2,073
  • 4
  • 20
  • 31
  • You need to add correct path of bridge header under Project - Build Settings - Swift Compiler Code Generation . – KKRocks Jun 23 '17 at 09:47
  • Possible duplicate of [Use of unresolved identifier GGLContext and GAI](https://stackoverflow.com/questions/37241346/use-of-unresolved-identifier-gglcontext-and-gai) – deadbeef Jun 23 '17 at 09:47
  • 2
    it's not a duplicate - something is wrong with the new pods and docs haven't been updated. I'm having a similar problem with the GoogleSignin. Normally you would simply "import Google" to get the context, however, this namespace doesn't exist anymore in the new pods. – batkuip Jun 28 '17 at 05:32
  • I just updated to GoogleAnalytics too, and I'm having the same issue! did you figure out how to fix it? Thanks! – ordinaryman09 Sep 26 '17 at 02:15
  • @ordinaryman09 I think GA has since been incorporated into Firebase, might be good to try using that instead. – mike Sep 26 '17 at 11:42
  • I don't think it's a duplicate, but the accepted answer of the following question resolved this issue for me: https://stackoverflow.com/a/43693022/5366205 – choofie Oct 17 '17 at 10:15

1 Answers1

0

This answer was the correct one, not the one marked as "correct" since it suggests to use deprecated version of libraries instead of moving on with the new versions and updating your project accordingly: https://stackoverflow.com/a/46858690/3506788

If you use Firebase, make sure that you initialise Firebase before using this line:

GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
Toka
  • 903
  • 7
  • 12