Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode error: "Use of unresolved identifier: GGLContext" (without CocoaPods)

I have done web development for a couple years and this is my first project with an iOS application. I have followed all of the instructions from Google's Get the Google Sign-in SDK for iOS (without CocoaPods), and I tried simulating the application and I'm getting this error: Use of unresolved identifier 'GGLContext'

This is the code that is copied from Google's page and put into AppDelegate.swift :

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  // Override point for customization after application launch.
  // Initialize Google sign-in
  var configureError: NSError?
  GGLContext.sharedInstance().configureWithError(&configureError)  // THIS LINE HAS THE ERROR
  assert(configureError == nil, "Error configuring Google services: \(configureError)")

  //GIDSignIn.sharedInstance().delegate = self
  GIDSignIn.sharedInstance().clientID = MY_CLIENT_ID

        return true
    }

Any help?

like image 201
krummens Avatar asked Jun 09 '16 18:06

krummens


1 Answers

I faced the same problem as you then I decided to read the Google's Tutorial again, looking for the word "manually", and here's what they say:

Note: If you manually installed the SDK, you should instead configure the GIDSignIn object directly, using the client ID found in the GoogleService-Info.plist file:

GIDSignIn.sharedInstance().clientID = kClientID

So just comment the lines related to GGLContext and I think that should work for this problem.

like image 94
Yago Zardo Avatar answered Nov 18 '22 12:11

Yago Zardo